diff --git a/hosts/architect/default.nix b/hosts/architect/default.nix index df7ecba..8594e26 100644 --- a/hosts/architect/default.nix +++ b/hosts/architect/default.nix @@ -40,6 +40,7 @@ in ./teslamate.nix ./postgres.nix ./netdata.nix + ./homeassistant.nix ]; age.identityPaths = [ "/root/.ssh/id_ed25519" ]; diff --git a/hosts/architect/homeassistant.nix b/hosts/architect/homeassistant.nix new file mode 100644 index 0000000..187b084 --- /dev/null +++ b/hosts/architect/homeassistant.nix @@ -0,0 +1,60 @@ +{ config, pkgs, ... }: + +let + domain = "home.giugl.io"; +in +{ + services.home-assistant = { + enable = true; + config = { + http = { + server_host = "127.0.0.1"; + server_port = 8123; + use_x_forwarded_for = true; + trusted_proxies = [ "127.0.0.1" ]; + }; + homeassistant = { + name = "Underwood House"; + unit_system = "metric"; + }; + default_config = { }; + }; + extraComponents = [ + "otbr" + "litterrobot" + "apple_tv" + "homekit" + "homekit_controller" + "spotify" + "hue" + "sonos" + "tplink" + "ollama" + "wyoming" + "whisper" + "piper" + "isal" + "radarr" + "sonarr" + ]; + extraPackages = python3Packages: with python3Packages; [ + pkgs.openai-whisper + openai-whisper + pkgs.piper-tts + pkgs.wyoming-piper + ]; + }; + + architect.vhost.${domain} = with config.architect.networks; { + dnsInterfaces = [ "tailscale" "lan" ]; + + locations."/" = { + port = config.services.home-assistant.config.http.server_port; + allowLan = true; + proxyWebsockets = true; + allow = [ + tailscale.net + ]; + }; + }; +}