zones: resolve enthalpy addresses temporarily

This commit is contained in:
Lu Wang 2024-12-16 22:46:41 +08:00
parent c615e72739
commit acc70f889e
Signed by: rebmit
SSH key fingerprint: SHA256:3px8QV1zEerIrEWHaqtH5rR9kjetyRST5EipOPrd+bU
2 changed files with 25 additions and 11 deletions

View file

@ -12,6 +12,7 @@
ethtool
ipcalc
iperf3
knot-dns
nmap
rsync
socat

View file

@ -2,7 +2,9 @@
with dns.lib.combinators;
let
common = import ./common.nix;
hosts = lib.filterAttrs (_name: value: value.endpoints != [ ]) common.hosts;
inherit (common) hosts;
publicHosts = lib.filterAttrs (_name: value: value.endpoints != [ ]) hosts;
enthalpyHosts = lib.filterAttrs (_name: value: value.enthalpy_node_address != null) hosts;
in
dns.lib.toString "rebmit.link" {
inherit (common)
@ -10,7 +12,10 @@ dns.lib.toString "rebmit.link" {
SOA
NS
;
subdomains = builtins.mapAttrs (_name: value: {
subdomains = lib.listToAttrs (
lib.mapAttrsToList (
name: value:
lib.nameValuePair name {
A = value.endpoints_v4;
AAAA = value.endpoints_v6;
HTTPS = [
@ -21,5 +26,13 @@ dns.lib.toString "rebmit.link" {
];
}
];
}) hosts;
}
) publicHosts
++ lib.mapAttrsToList (
name: value:
lib.nameValuePair "${name}.enta" {
AAAA = [ value.enthalpy_node_address ];
}
) enthalpyHosts
);
}