From e7f4d76dc11b427718e239c4de580b911707208e Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Tue, 20 Feb 2024 17:47:34 +0100 Subject: [PATCH] fix(dgn-network): Clarify variables and add dns settings from metadata --- modules/dgn-network.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/dgn-network.nix b/modules/dgn-network.nix index 11ce62a..888c8be 100644 --- a/modules/dgn-network.nix +++ b/modules/dgn-network.nix @@ -14,7 +14,7 @@ let optionalAttrs ; - net = meta.network.${name}; + net' = meta.network.${name}; mkAddress = { address, prefixLength, ... }: "${address}/${builtins.toString prefixLength}"; mkRoute = gateway: { @@ -41,7 +41,7 @@ let "2001:4860:4860::8888#dns.google" "2606:4700:4700::1001#cloudflare-dns.com" "2001:4860:4860::8844#dns.google" - ]; + ] ++ (net'.dns or [ ]); networkConfig = optionalAttrs (net ? DHCP) { inherit (net) DHCP; }; }; @@ -56,7 +56,7 @@ in config = mkIf cfg.enable { networking = { - inherit (net) hostId; + inherit (net') hostId; hostName = name; domain = "${meta.nodes.${name}.zone}.infra.dgnum.eu"; @@ -65,6 +65,6 @@ in firewall.logRefusedConnections = false; }; - systemd.network.networks = mapAttrs' mkInterface net.interfaces; + systemd.network.networks = mapAttrs' mkInterface net'.interfaces; }; }