mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 10:31:34 +01:00
networking: Add dnsServers option
This commit is contained in:
parent
ceeac97675
commit
11769ee3ac
2 changed files with 10 additions and 5 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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 ];
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue