diff options
Diffstat (limited to 'os/kay/modules/home-assistant.nix')
-rw-r--r-- | os/kay/modules/home-assistant.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/os/kay/modules/home-assistant.nix b/os/kay/modules/home-assistant.nix new file mode 100644 index 0000000..b611817 --- /dev/null +++ b/os/kay/modules/home-assistant.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: { + services.postgresql = { + enable = true; + + ensureDatabases = [ "hass" ]; + ensureUsers = [{ + name = "hass"; + ensureDBOwnership = true; + }]; + }; + + services.home-assistant = { + enable = true; + package = (pkgs.home-assistant.override { + extraPackages = py: with py; [ psycopg2 ]; + }).overrideAttrs (oldAttrs: { + doInstallCheck = false; + }); + + extraComponents = [ + "analytics" + "google_translate" + "met" + "radio_browser" + "shopping_list" + ]; + + config = { + default_config = {}; + + recorder.db_url = "postgresql://@/hass"; + http = { + server_host = "127.0.0.1"; + trusted_proxies = [ "127.0.0.1" ]; + use_x_forwarded_for = true; + }; + }; + }; +} |