summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-01-21 11:51:15 +0100
committertv <tv@krebsco.de>2019-01-21 11:51:15 +0100
commitf1298103173cf1953be0e7c359f10d18894ce770 (patch)
tree94eb7068c64eee27e7fcddf2329eb66324a53423 /krebs/3modules
parentaf0463b23493d8c31ce725beb8ff5a2fd0398001 (diff)
krebs hosts: extraHost -> hosts
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/hosts.nix25
1 files changed, 12 insertions, 13 deletions
diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix
index a95557b3d..0985bb539 100644
--- a/krebs/3modules/hosts.nix
+++ b/krebs/3modules/hosts.nix
@@ -13,24 +13,23 @@ in {
};
config = {
- networking.extraHosts =
- concatStringsSep
- "\n"
- (flatten
- (mapAttrsToList
- (hostname: host:
- mapAttrsToList
- (netname: net: let
+ networking.hosts =
+ filterAttrs
+ (_name: value: value != [])
+ (zipAttrsWith
+ (_: concatLists)
+ (concatMap
+ (host:
+ concatMap
+ (net: let
aliases = longs ++ shorts;
longs = filter check net.aliases;
shorts = let s = ".${config.krebs.dns.search-domain}"; in
map (removeSuffix s) (filter (hasSuffix s) longs);
in
- optionals
- (aliases != [])
- (map (addr: "${addr} ${toString aliases}") net.addrs))
- (filterAttrs (name: host: host.aliases != []) host.nets))
- config.krebs.hosts));
+ map (addr: { ${addr} = aliases; }) net.addrs)
+ (attrValues host.nets))
+ (attrValues config.krebs.hosts)));
};
}