From acc70f889e4eacdf2678093cfccd0dd75c533b73 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Mon, 16 Dec 2024 22:46:41 +0800 Subject: [PATCH] zones: resolve enthalpy addresses temporarily --- nixos/profiles/programs/tools/network.nix | 1 + zones/rebmit.link.nix | 35 ++++++++++++++++------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/nixos/profiles/programs/tools/network.nix b/nixos/profiles/programs/tools/network.nix index 2da1022..73991fb 100644 --- a/nixos/profiles/programs/tools/network.nix +++ b/nixos/profiles/programs/tools/network.nix @@ -12,6 +12,7 @@ ethtool ipcalc iperf3 + knot-dns nmap rsync socat diff --git a/zones/rebmit.link.nix b/zones/rebmit.link.nix index 381c936..9f76119 100644 --- a/zones/rebmit.link.nix +++ b/zones/rebmit.link.nix @@ -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,16 +12,27 @@ dns.lib.toString "rebmit.link" { SOA NS ; - subdomains = builtins.mapAttrs (_name: value: { - A = value.endpoints_v4; - AAAA = value.endpoints_v6; - HTTPS = [ - { - alpn = [ - "h3" - "h2" + subdomains = lib.listToAttrs ( + lib.mapAttrsToList ( + name: value: + lib.nameValuePair name { + A = value.endpoints_v4; + AAAA = value.endpoints_v6; + HTTPS = [ + { + alpn = [ + "h3" + "h2" + ]; + } ]; } - ]; - }) hosts; + ) publicHosts + ++ lib.mapAttrsToList ( + name: value: + lib.nameValuePair "${name}.enta" { + AAAA = [ value.enthalpy_node_address ]; + } + ) enthalpyHosts + ); }