diff options
Diffstat (limited to 'krebs/3modules/hosts.nix')
-rw-r--r-- | krebs/3modules/hosts.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix index 7fe01a769..ae0136303 100644 --- a/krebs/3modules/hosts.nix +++ b/krebs/3modules/hosts.nix @@ -24,7 +24,11 @@ in { aliases = longs ++ shorts; longs = filter check net.aliases; shorts = let s = ".${config.krebs.dns.search-domain}"; in - map (removeSuffix s) (filter (hasSuffix s) longs); + optionals + (config.krebs.dns.search-domain != null) + (map (removeSuffix s) + (filter (hasSuffix s) + longs)); in map (addr: { ${addr} = aliases; }) net.addrs) (attrValues host.nets)) @@ -44,7 +48,9 @@ in { hostNetAliases = host: mapAttrs (_: net: filter (x: x.name != null && x.value != []) [ { name = net.ip4.addr or null; value = net.aliases; } + { name = net.ip4.addr or null; value = (map (alias: "4.${alias}") net.aliases); } { name = net.ip6.addr or null; value = net.aliases; } + { name = net.ip6.addr or null; value = (map (alias: "6.${alias}") net.aliases); } ]) host.nets; # netAliases : { ${netname} : [addrAliases] } |