From defbfce1fb819c0773b7b98578c7cdde90c64f62 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 30 Aug 2024 20:46:48 +0100 Subject: [PATCH] finish converting outputRef to lambda --- modules/hostapd/service.nix | 5 ++--- modules/secrets/default.nix | 2 +- modules/secrets/subscriber.nix | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/hostapd/service.nix b/modules/hostapd/service.nix index 4d0e261..cbb3037 100644 --- a/modules/hostapd/service.nix +++ b/modules/hostapd/service.nix @@ -50,9 +50,8 @@ let exec ${hostapd}/bin/hostapd -i $(output ${interface} ifname) -P /run/${name}/hostapd.pid -S /run/${name}/hostapd.conf ''; }; - watch = filter (f: typeOf f == "set") (attrValues attrs); + watch = filter (f: typeOf f == "lambda") (attrValues attrs); in svc.secrets.subscriber.build { - inherit watch; - inherit service; + inherit service watch; action = "restart-all"; } diff --git a/modules/secrets/default.nix b/modules/secrets/default.nix index 6ad06c5..c17c9fa 100644 --- a/modules/secrets/default.nix +++ b/modules/secrets/default.nix @@ -66,7 +66,7 @@ in { subscriber = config.system.callService ./subscriber.nix { watch = mkOption { description = "secrets paths to subscribe to"; - type = types.listOf types.attrs; + type = types.listOf (types.functionTo types.anything); }; service = mkOption { description = "subscribing service that will receive notification"; diff --git a/modules/secrets/subscriber.nix b/modules/secrets/subscriber.nix index 2b6f87c..2144798 100644 --- a/modules/secrets/subscriber.nix +++ b/modules/secrets/subscriber.nix @@ -8,8 +8,8 @@ let inherit (lib) unique optional; inherit (service) name; - watched-services = unique (map (f: f.service) watch); - paths = unique (map (f: f.path) watch); + watched-services = unique (map (f: f "service") watch); + paths = unique (map (f: f "path") watch); restart-flag = { restart = "-r";