krebs hosts: extraHost -> hosts
This commit is contained in:
parent
af0463b234
commit
f129810317
@ -13,24 +13,23 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
networking.extraHosts =
|
networking.hosts =
|
||||||
concatStringsSep
|
filterAttrs
|
||||||
"\n"
|
(_name: value: value != [])
|
||||||
(flatten
|
(zipAttrsWith
|
||||||
(mapAttrsToList
|
(_: concatLists)
|
||||||
(hostname: host:
|
(concatMap
|
||||||
mapAttrsToList
|
(host:
|
||||||
(netname: net: let
|
concatMap
|
||||||
|
(net: let
|
||||||
aliases = longs ++ shorts;
|
aliases = longs ++ shorts;
|
||||||
longs = filter check net.aliases;
|
longs = filter check net.aliases;
|
||||||
shorts = let s = ".${config.krebs.dns.search-domain}"; in
|
shorts = let s = ".${config.krebs.dns.search-domain}"; in
|
||||||
map (removeSuffix s) (filter (hasSuffix s) longs);
|
map (removeSuffix s) (filter (hasSuffix s) longs);
|
||||||
in
|
in
|
||||||
optionals
|
map (addr: { ${addr} = aliases; }) net.addrs)
|
||||||
(aliases != [])
|
(attrValues host.nets))
|
||||||
(map (addr: "${addr} ${toString aliases}") net.addrs))
|
(attrValues config.krebs.hosts)));
|
||||||
(filterAttrs (name: host: host.aliases != []) host.nets))
|
|
||||||
config.krebs.hosts));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user