forked from clan/clan-core
modules: static hosts filter nonexistent ip
This commit is contained in:
parent
fd29ed4693
commit
39b34d9ff3
@ -18,7 +18,13 @@
|
|||||||
name: _: !(lib.elem name config.clan.static-hosts.excludeHosts)
|
name: _: !(lib.elem name config.clan.static-hosts.excludeHosts)
|
||||||
) machines;
|
) machines;
|
||||||
in
|
in
|
||||||
(lib.mapAttrs' (
|
lib.filterAttrs (_: value: value != null) (
|
||||||
machine: _: lib.nameValuePair (builtins.readFile (zerotierIpMachinePath machine)) [ machine ]
|
lib.mapAttrs' (
|
||||||
) filteredMachines);
|
machine: _:
|
||||||
|
let
|
||||||
|
path = zerotierIpMachinePath machine;
|
||||||
|
in
|
||||||
|
if builtins.pathExists path then lib.nameValuePair (builtins.readFile path) [ machine ] else null
|
||||||
|
) filteredMachines
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user