feat(architect): add Home Assistant configuration

- Added `homeassistant.nix` to the list of services in `default.nix`
- Configured Home Assistant with basic settings and extra components
- Set up vhost for Home Assistant with specified domain and network interfaces
- Included necessary Python packages for Home Assistant components
This commit is contained in:
Giulio De Pasquale 2024-12-09 10:35:38 +00:00
parent 29c2526e6a
commit 203a4edcd6
2 changed files with 61 additions and 0 deletions

View File

@ -40,6 +40,7 @@ in
./teslamate.nix
./postgres.nix
./netdata.nix
./homeassistant.nix
];
age.identityPaths = [ "/root/.ssh/id_ed25519" ];

View File

@ -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
];
};
};
}