liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit defbfce1fb819c0773b7b98578c7cdde90c64f62
parent 0df2c83382f98eed7717cecdbbc6d12e5fef2202
Author: Daniel Barlow <dan@telent.net>
Date:   Fri, 30 Aug 2024 20:46:48 +0100

finish converting outputRef to lambda

Diffstat:
Mmodules/hostapd/service.nix | 5++---
Mmodules/secrets/default.nix | 2+-
Mmodules/secrets/subscriber.nix | 4++--
3 files changed, 5 insertions(+), 6 deletions(-)

diff --git 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 @@ -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 @@ -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";