From 29405fae485eb54817ad749d1a0efee5249f4b4d Mon Sep 17 00:00:00 2001 From: niten Date: Thu, 18 Jul 2024 12:12:45 -0700 Subject: [PATCH] Include only real hosts from local site in hosts --- lib/fudo/local-network.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/fudo/local-network.nix b/lib/fudo/local-network.nix index 333a98f..18905ff 100644 --- a/lib/fudo/local-network.nix +++ b/lib/fudo/local-network.nix @@ -116,15 +116,10 @@ in { config = mkIf cfg.enable { - fudo.system.hostfile-entries = let - other-hosts = - filterAttrs (hostname: hostOpts: hostname != config.instance.hostname) - cfg.zone-definition.hosts; - in mapAttrs' (hostname: hostOpts: - nameValuePair hostOpts.ipv4-address [ - "${hostname}.${cfg.domain}" - hostname - ]) other-hosts; + fudo.system.hostfile-entries = mapAttrs' (hostname: _: + nameValuePair (getHostIpv4 hostname) [ (getHostFqdn hostname) hostname ]) + (filterAttrs (_: hostOpts: hostOpts.site == config.instance.local-site) + config.fudo.hosts); services.kea.dhcp4 = { enable = true;