krebs: DRY up shorts of the networking.extraHosts generator
This commit is contained in:
parent
df89fb7e91
commit
a1f7f5e510
@ -103,10 +103,8 @@ let
|
|||||||
aliases = longs ++ shorts;
|
aliases = longs ++ shorts;
|
||||||
providers = dns.split-by-provider net.aliases cfg.dns.providers;
|
providers = dns.split-by-provider net.aliases cfg.dns.providers;
|
||||||
longs = providers.hosts;
|
longs = providers.hosts;
|
||||||
shorts =
|
shorts = let s = ".${cfg.search-domain}"; in
|
||||||
map (removeSuffix ".${cfg.search-domain}")
|
map (removeSuffix s) (filter (hasSuffix s) longs);
|
||||||
(filter (hasSuffix ".${cfg.search-domain}")
|
|
||||||
longs);
|
|
||||||
in
|
in
|
||||||
map (addr: "${addr} ${toString aliases}") net.addrs
|
map (addr: "${addr} ${toString aliases}") net.addrs
|
||||||
) (filterAttrs (name: host: host.aliases != []) host.nets)
|
) (filterAttrs (name: host: host.aliases != []) host.nets)
|
||||||
|
Loading…
Reference in New Issue
Block a user