diff --git a/modules/system/networking.nix b/modules/system/networking.nix index 4eaace7..bf52aec 100644 --- a/modules/system/networking.nix +++ b/modules/system/networking.nix @@ -47,6 +47,15 @@ in type = lib.types.nonEmptyStr; default = "nebula@mesh.service"; }; + + dnsServers = lib.mkOption { + type = lib.types.anything; + default = + self.nixosConfigurations + |> lib.attrValues + |> lib.filter (host: host.config.custom.services.dns.enable) + |> lib.map (host: host.config.custom.networking.overlay.address); + }; }; underlay = { diff --git a/modules/system/services/nebula/default.nix b/modules/system/services/nebula/default.nix index e02c275..330c6a3 100644 --- a/modules/system/services/nebula/default.nix +++ b/modules/system/services/nebula/default.nix @@ -87,11 +87,7 @@ in systemd.network.networks."40-nebula" = { matchConfig.Name = netCfg.overlay.interface; address = [ "${netCfg.overlay.address}/${toString netCfg.overlay.prefixLength}" ]; - dns = - self.nixosConfigurations - |> lib.attrValues - |> lib.filter (host: host.config.custom.services.dns.enable) - |> lib.map (host: host.config.custom.networking.overlay.address); + dns = netCfg.overlay.dnsServers; domains = [ netCfg.overlay.domain ]; }; };