summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-08-22 09:07:03 +0100
committerGitea <gitea@fake.local>2020-09-15 21:03:25 +0000
commite87f9e002bfb458ea9ab6dcdab482df315b94d09 (patch)
tree9d6bf040206c7b7b63753b7cea26e502f89e01b1
parente6a8d378460827bab9a0fd45a50faa5eca7e8ae0 (diff)
mic92: add v4/v6 aliases to etc hosts
this is convinient when you only want to speak a certain protocol
-rw-r--r--krebs/3modules/hosts.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix
index 159b54e34..ae0136303 100644
--- a/krebs/3modules/hosts.nix
+++ b/krebs/3modules/hosts.nix
@@ -48,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] }