diff options
-rw-r--r-- | nixos/hosts/ev/default.nix | 1 | ||||
-rw-r--r-- | nixos/hosts/ev/hosehawk.nix | 24 |
2 files changed, 20 insertions, 5 deletions
diff --git a/nixos/hosts/ev/default.nix b/nixos/hosts/ev/default.nix index a3dd610..71f794c 100644 --- a/nixos/hosts/ev/default.nix +++ b/nixos/hosts/ev/default.nix @@ -45,6 +45,7 @@ monitoring.lokiPort = 3030; monitoring.prometheusPort = 9090; monitoring.prometheusNodeExporterPort = 9002; + hosehawk.port = 4000; home-automation.zigbeeSerialPort = "/dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_e2fed465c59ded11962fd7a5a7669f5d-if00-port0"; diff --git a/nixos/hosts/ev/hosehawk.nix b/nixos/hosts/ev/hosehawk.nix index 146272d..09637cd 100644 --- a/nixos/hosts/ev/hosehawk.nix +++ b/nixos/hosts/ev/hosehawk.nix @@ -1,14 +1,28 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: +let + cfg = config.hosehawk; +in { imports = [ /home/martin/repos/hosehawk/services/hosenest.nix /home/martin/repos/hosehawk/services/hosehawk.nix ]; - services.hosenest.enable = true; - services.hosehawk = { - enable = true; - hosenestUrl = "http://localhost:${toString config.services.hosenest.port}/"; + options.hosehawk = { + port = lib.mkOption { + type = lib.types.int; + }; + }; + + config = { + services.hosenest = { + enable = true; + port = cfg.port; + }; + services.hosehawk = { + enable = true; + hosenestUrl = "http://localhost:${toString cfg.port}/"; + }; }; } |