mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 11:41: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;
|
type = lib.types.nonEmptyStr;
|
||||||
default = "nebula@mesh.service";
|
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 = {
|
underlay = {
|
||||||
|
|
|
||||||
|
|
@ -87,11 +87,7 @@ in
|
||||||
systemd.network.networks."40-nebula" = {
|
systemd.network.networks."40-nebula" = {
|
||||||
matchConfig.Name = netCfg.overlay.interface;
|
matchConfig.Name = netCfg.overlay.interface;
|
||||||
address = [ "${netCfg.overlay.address}/${toString netCfg.overlay.prefixLength}" ];
|
address = [ "${netCfg.overlay.address}/${toString netCfg.overlay.prefixLength}" ];
|
||||||
dns =
|
dns = netCfg.overlay.dnsServers;
|
||||||
self.nixosConfigurations
|
|
||||||
|> lib.attrValues
|
|
||||||
|> lib.filter (host: host.config.custom.services.dns.enable)
|
|
||||||
|> lib.map (host: host.config.custom.networking.overlay.address);
|
|
||||||
domains = [ netCfg.overlay.domain ];
|
domains = [ netCfg.overlay.domain ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue