From 5da4a5c8ea4a052d8bb0ea0fa59e6064f19cf659 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Sat, 25 Jan 2025 14:55:34 -0800 Subject: [PATCH] Proxied home-assistant and added SSL --- hosts/Alaska/modules/home-assistant.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hosts/Alaska/modules/home-assistant.nix b/hosts/Alaska/modules/home-assistant.nix index d438aba..b520f54 100644 --- a/hosts/Alaska/modules/home-assistant.nix +++ b/hosts/Alaska/modules/home-assistant.nix @@ -3,7 +3,7 @@ { services.home-assistant = { enable = true; - openFirewall = true; + openFirewall = false; # List extraComponents here to be installed. The names can be found here: # https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/home-assistant/component-packages.nix @@ -24,12 +24,23 @@ ]; config = { + http = { + server_port = 8123; + trusted_proxies = [ "127.0.0.1" ]; + use_x_forwarded_for = true; + }; + homeassistant = { + name = "Alaska"; + temperature_unit = "F"; + }; }; }; services.nginx.virtualHosts = { "home-assistant.nickiel.net" = { + forceSSL = true; + enableACME = true; locations."/" = { proxyPass = "http://127.0.0.1:8123"; proxyWebsockets = true;