From 6ea59761da902d3ec0cf5c5425b1b7a61eb182e2 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 28 Oct 2024 20:10:39 -0500 Subject: [PATCH] add a home-assistant instance --- boxes/copernicus/services/default.nix | 1 + boxes/copernicus/services/hass.nix | 17 +++++++++++++++++ boxes/netbox/default.nix | 1 + boxes/netbox/homeassistant-bridge.nix | 16 ++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 boxes/copernicus/services/hass.nix create mode 100644 boxes/netbox/homeassistant-bridge.nix 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; + ''; + }; + }; +}