lib/dns: exclude ipv6 ctx yggdrasil

This commit is contained in:
Astro 2022-01-25 01:07:17 +01:00
parent 766a2db2d2
commit b393efecf7
1 changed files with 16 additions and 13 deletions

View File

@ -123,19 +123,22 @@ rec {
# `{ dn42 = { "...ip6.arpa" = "lo.core.zentralwerk.dn42"; }; }` # `{ dn42 = { "...ip6.arpa" = "lo.core.zentralwerk.dn42"; }; }`
reverseHosts6 = builtins.foldl' (result: net: lib.recursiveUpdate result ( reverseHosts6 = builtins.foldl' (result: net: lib.recursiveUpdate result (
builtins.mapAttrs (ctx: hosts: builtins.mapAttrs (ctx: hosts:
builtins.foldl' (result: host: if ctx == "yggdrasil"
let then {}
domain = else
if ctx == "dn42" builtins.foldl' (result: host:
then namedNets.${net}.domainName let
else if builtins.match "up.*" ctx != null domain =
then "${net}.zentralwerk.org" if ctx == "dn42"
else throw "Invalid IPv6 context: ${ctx}"; then "${net}.zentralwerk.dn42"
in else if builtins.match "up.*" ctx != null
lib.recursiveUpdate result { then namedNets.${net}.domainName
"${ipv6ToReverse hosts.${host}}" = "${host}.${domain}"; else throw "Invalid IPv6 context: ${ctx}";
} in
) {} (builtins.attrNames hosts) lib.recursiveUpdate result {
"${ipv6ToReverse hosts.${host}}" = "${host}.${domain}";
}
) {} (builtins.attrNames hosts)
) namedNets.${net}.hosts6 ) namedNets.${net}.hosts6
)) {} (builtins.attrNames namedNets); )) {} (builtins.attrNames namedNets);