1
0
Fork 0

finish converting outputRef to lambda

This commit is contained in:
Daniel Barlow 2024-08-30 20:46:48 +01:00
parent 0df2c83382
commit defbfce1fb
3 changed files with 5 additions and 6 deletions

View File

@ -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";
}

View File

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

View File

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