diff --git a/machines/aresix/configuration.nix b/machines/aresix/configuration.nix index 2bf5e14..84c3b58 100644 --- a/machines/aresix/configuration.nix +++ b/machines/aresix/configuration.nix @@ -1,7 +1,7 @@ {...}: { imports = [ ./modules/reverse-proxy.nix - ./modules/home-assistant.nix + ./modules/home-assistant ./modules/dyndns.nix ./modules/network.nix ]; diff --git a/machines/aresix/modules/home-assistant/custom_components/panel_proxy.nix b/machines/aresix/modules/home-assistant/custom_components/panel_proxy.nix new file mode 100644 index 0000000..2afc0cf --- /dev/null +++ b/machines/aresix/modules/home-assistant/custom_components/panel_proxy.nix @@ -0,0 +1,18 @@ +{ + stdenv, + pkgs, + fetchFromGitHub, + buildHomeAssistantComponent, +}: +buildHomeAssistantComponent rec { + owner = "jimparis"; + domain = "panel_proxy"; + version = "1.0.0"; + + src = fetchFromGitHub { + owner = "jimparis"; + repo = "hass-panel-proxy"; + rev = "e5421e013b7aa011609f7e7be9f0c2c017f029df"; + sha256 = "sha256-eq1sZmZBpRGOyhDduT40z+xhbq5DD1hgz9jSyKhX8QI="; + }; +} diff --git a/machines/aresix/modules/home-assistant.nix b/machines/aresix/modules/home-assistant/default.nix similarity index 81% rename from machines/aresix/modules/home-assistant.nix rename to machines/aresix/modules/home-assistant/default.nix index 439bf53..652825f 100644 --- a/machines/aresix/modules/home-assistant.nix +++ b/machines/aresix/modules/home-assistant/default.nix @@ -1,6 +1,7 @@ { inputs, config, + pkgs, ... }: { imports = [inputs.tg-ha-door.nixosModules.tg-ha-door]; @@ -37,7 +38,10 @@ }; }; - services.esphome.enable = true; + services.esphome = { + enable = true; + address = "::1"; # Proxied trough home assistant + }; services.home-assistant = { enable = true; @@ -57,7 +61,17 @@ "esphome" "mobile_app" ]; + customComponents = [(pkgs.callPackage ./custom_components/panel_proxy.nix {})]; config = { + panel_proxy = { + esphome = { + title = "ESPHome Dashboard"; + icon = "mdi:chip"; + url = "http://[::1]:6052/"; + require_admin = true; + }; + }; + http = { trusted_proxies = ["::1"]; use_x_forwarded_for = true;