diff options
author | Martin Fischer <martin@push-f.com> | 2025-09-18 06:26:56 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-09-18 10:26:02 +0200 |
commit | 0f3a5b5a74150ecec89c6befe0510975e2fba5ac (patch) | |
tree | 6215bb6202b699fbdbca969689c8886be166210f /nixos/hosts | |
parent | e78b42dfe2d4852a39770f8b16b46eed1780e87a (diff) |
refactor: specify hosehawk port
Diffstat (limited to 'nixos/hosts')
-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}/"; + }; }; } |