diff options
Diffstat (limited to 'os/kay/modules')
-rw-r--r-- | os/kay/modules/dns/sinanmohd.com.zone | 3 | ||||
-rw-r--r-- | os/kay/modules/home-assistant.nix | 39 | ||||
-rw-r--r-- | os/kay/modules/www.nix | 10 |
3 files changed, 51 insertions, 1 deletions
diff --git a/os/kay/modules/dns/sinanmohd.com.zone b/os/kay/modules/dns/sinanmohd.com.zone index 0409efc..f3caf8f 100644 --- a/os/kay/modules/dns/sinanmohd.com.zone +++ b/os/kay/modules/dns/sinanmohd.com.zone @@ -2,7 +2,7 @@ $ORIGIN sinanmohd.com. $TTL 2d @ IN SOA ns1 hostmaster ( - 2024022700 ; serial + 2024091105 ; serial 2h ; refresh 5m ; retry 1d ; expire @@ -40,6 +40,7 @@ www IN CNAME @ git IN CNAME @ bin IN CNAME @ static IN CNAME @ +home IN CNAME @ lia IN A 65.0.3.127 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; + }; + }; + }; +} diff --git a/os/kay/modules/www.nix b/os/kay/modules/www.nix index 54eab65..f565cac 100644 --- a/os/kay/modules/www.nix +++ b/os/kay/modules/www.nix @@ -87,6 +87,16 @@ in locations."= /".return = "301 https://www.${domain}"; }; + "home.${domain}" = defaultOpts // { + extraConfig = "proxy_buffering off;"; + locations."/" = { + proxyWebsockets = true; + proxyPass = "http://127.0.0.1:${ + builtins.toString config.services.home-assistant.config.http.server_port + }"; + }; + }; + "${fscusat}" = defaultOpts // { useACMEHost = null; enableACME = true; |