diff --git a/boxes/copernicus/services/default.nix b/boxes/copernicus/services/default.nix index f539ace..a16ba8e 100644 --- a/boxes/copernicus/services/default.nix +++ b/boxes/copernicus/services/default.nix @@ -5,5 +5,6 @@ ./photoprism.nix ./wireguard.nix ./grafana.nix + ./hass.nix ]; } diff --git a/boxes/copernicus/services/hass.nix b/boxes/copernicus/services/hass.nix new file mode 100644 index 0000000..87f8254 --- /dev/null +++ b/boxes/copernicus/services/hass.nix @@ -0,0 +1,17 @@ +{ lib, config, pkgs, ...}: + +{ + services.home-assistant = { + enable = true; + extraComponents = [ + "esphome" + "met" + "radio_browser" + ]; + config = { + http.server_host = "10.100.0.2"; + http.server_port = 9004; + default_config = {}; + }; + }; +} diff --git a/boxes/netbox/default.nix b/boxes/netbox/default.nix index 4e2e267..b8c29bb 100644 --- a/boxes/netbox/default.nix +++ b/boxes/netbox/default.nix @@ -19,6 +19,7 @@ ./wireguard.nix ./photoprism-bridge.nix ./grafana-bridge.nix + ./homeassistant-bridge.nix ./prometheus.nix ]; diff --git a/boxes/netbox/homeassistant-bridge.nix b/boxes/netbox/homeassistant-bridge.nix new file mode 100644 index 0000000..3c8bb5f --- /dev/null +++ b/boxes/netbox/homeassistant-bridge.nix @@ -0,0 +1,16 @@ +{ lib, config, pkgs, ... }: +{ + services.nginx.virtualHosts."home.beepboop.systems" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://10.100.0.2:9004"; + proxyWebsockets = true; + extraConfig = '' + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $host; + proxy_buffering off; + ''; + }; + }; +}