nixos/hosts/architect/homeassistant.nix
2025-04-18 16:15:32 +01:00

116 lines
2.4 KiB
Nix

{ config, pkgs, ... }:
let
domain = "home.giugl.io";
piperPort = 10200;
whisperPort = 10300;
in
{
services.go2rtc = {
enable = true;
settings.api.listen = "127.0.0.1:1984";
};
# services.wyoming = {
# faster-whisper = {
# servers."home" = {
# enable = true;
# uri = "tcp://127.0.0.1:${toString whisperPort}";
# model = "large-v3";
# device = "cuda";
# language = "en";
# };
# };
# piper = {
# servers."home" = {
# enable = true;
# uri = "tcp://127.0.0.1:${toString piperPort}";
# voice = "en-us-ryan-medium";
# lengthScale = 0.63;
# };
# };
# };
services.home-assistant = {
enable = true;
package = pkgs.unstablePkgs.home-assistant;
config = {
http = {
server_host = "127.0.0.1";
server_port = 8123;
use_x_forwarded_for = true;
trusted_proxies = [ "127.0.0.1" ];
};
homeassistant = {
name = "Brigettine Square";
latitude = 52.1958;
longitude = 0.180746;
unit_system = "metric";
};
default_config = { };
automation = "!include automations.yaml";
frontend.themes = "!include_dir_merge_named themes";
};
extraComponents = [
"otbr"
"litterrobot"
"apple_tv"
"homekit"
"homekit_controller"
"spotify"
"hue"
"sonos"
"tplink"
"ollama"
"wyoming"
"whisper"
"piper"
"isal"
"radarr"
"sonarr"
"mqtt"
"mqtt_eventstream"
"mqtt_json"
"mqtt_room"
"mqtt_statestream"
"github"
"webostv"
"reolink"
"onvif"
"xiaomi_miio"
"ring"
];
extraPackages = python3Packages: with pkgs.unstablePkgs.python3Packages; [
pyporscheconnectapi
];
};
services.mosquitto = {
enable = true;
listeners = [
{
address = "127.0.0.1";
acl = [ "pattern readwrite #" ];
omitPasswordAuth = true;
settings.allow_anonymous = true;
}
];
};
architect.vhost.${domain} = with config.architect.networks; {
dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = {
port = config.services.home-assistant.config.http.server_port;
allowWAN = true;
allowLan = true;
proxyWebsockets = true;
allow = [
tailscale.net
];
};
};
}