From 26e687033774718a67f91dbf756b5f1f27a7215a Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 2 Aug 2026 22:04:34 +0100 Subject: [PATCH] lib/home: Centralise advertised search domains radvd's DNSSL and kea's domain-search hardcoded the same list of search domains in two places. Hoist it to lib.my.c.home.searchDomains so there is a single source of truth (and so other consumers, such as statically-configured boxes, can reuse it). No change to what is advertised. Co-Authored-By: Claude Opus 4.8 --- lib/constants.nix | 2 ++ nixos/boxes/home/routing-common/kea.nix | 6 +++--- nixos/boxes/home/routing-common/radvd.nix | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/constants.nix b/lib/constants.nix index a5df815..7f530c6 100644 --- a/lib/constants.nix +++ b/lib/constants.nix @@ -307,6 +307,8 @@ rec { home = rec { domain = "h.${pubDomain}"; + # Search domains advertised to clients (radvd DNSSL / kea domain-search) + searchDomains = [ domain "dyn.${domain}" colony.domain britway.domain ]; vlans = { hi = 100; lo = 110; diff --git a/nixos/boxes/home/routing-common/kea.nix b/nixos/boxes/home/routing-common/kea.nix index 091f42d..57237a6 100644 --- a/nixos/boxes/home/routing-common/kea.nix +++ b/nixos/boxes/home/routing-common/kea.nix @@ -1,8 +1,8 @@ index: { lib, pkgs, config, assignments, allAssignments, ... }: let - inherit (lib) mkForce; + inherit (lib) mkForce concatStringsSep; inherit (lib.my) net netbootKeaClientClasses; - inherit (lib.my.c.home) domain prefixes vips hiMTU; + inherit (lib.my.c.home) domain searchDomains prefixes vips hiMTU; dns-servers = [ { @@ -59,7 +59,7 @@ in } { name = "domain-search"; - data = "${domain}, dyn.${domain}, ${lib.my.c.colony.domain}, ${lib.my.c.britway.domain}"; + data = concatStringsSep ", " searchDomains; always-send = true; } ]; diff --git a/nixos/boxes/home/routing-common/radvd.nix b/nixos/boxes/home/routing-common/radvd.nix index 1764ed0..0749346 100644 --- a/nixos/boxes/home/routing-common/radvd.nix +++ b/nixos/boxes/home/routing-common/radvd.nix @@ -1,8 +1,8 @@ index: { lib, pkgs, ... }: let - inherit (lib) mkForce concatMapStringsSep; + inherit (lib) mkForce concatMapStringsSep concatStringsSep; inherit (lib.my) net; - inherit (lib.my.c.home) domain prefixes vips; + inherit (lib.my.c.home) domain searchDomains prefixes vips; # untrusted uses external (Cloudflare) resolvers, matching the v4 kea config; # trusted VLANs use the internal recursor via its floating VRRP VIP @@ -18,7 +18,7 @@ let AdvLinkMTU ${toString prefixes."${name}".mtu}; prefix ${prefixes."${name}".v6} {}; RDNSS ${rdnss name} {}; - DNSSL ${domain} dyn.${domain} ${lib.my.c.colony.domain} ${lib.my.c.britway.domain} {}; + DNSSL ${concatStringsSep " " searchDomains} {}; }; ''; in