mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 17:49:07 +01:00
networking/overlay: Use blocking-nameservers as default nameservers
This commit is contained in:
parent
1c0cb61cdf
commit
5f8b5c04b3
2 changed files with 20 additions and 9 deletions
|
|
@ -6,6 +6,24 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.custom.networking.overlay;
|
cfg = config.custom.networking.overlay;
|
||||||
|
|
||||||
|
blocking-nameservers =
|
||||||
|
allHosts
|
||||||
|
|> lib.attrValues
|
||||||
|
|> lib.filter (host: host.config.custom.services.blocking-nameserver.enable)
|
||||||
|
|> lib.map (
|
||||||
|
host:
|
||||||
|
"${host.config.custom.networking.overlay.address}:${toString host.config.custom.services.blocking-nameserver.port}"
|
||||||
|
);
|
||||||
|
|
||||||
|
recursive-nameservers =
|
||||||
|
allHosts
|
||||||
|
|> lib.attrValues
|
||||||
|
|> lib.filter (host: host.config.custom.services.recursive-nameserver.enable)
|
||||||
|
|> lib.map (
|
||||||
|
host:
|
||||||
|
"${host.config.custom.networking.overlay.address}:${toString host.config.custom.services.recursive-nameserver.port}"
|
||||||
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.custom.networking.overlay = {
|
options.custom.networking.overlay = {
|
||||||
|
|
@ -60,14 +78,7 @@ in
|
||||||
|
|
||||||
dnsServers = lib.mkOption {
|
dnsServers = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.nonEmptyStr;
|
type = lib.types.listOf lib.types.nonEmptyStr;
|
||||||
default =
|
default = if (blocking-nameservers != [ ]) then blocking-nameservers else recursive-nameservers;
|
||||||
allHosts
|
|
||||||
|> lib.attrValues
|
|
||||||
|> lib.filter (host: host.config.custom.services.recursive-nameserver.enable)
|
|
||||||
|> lib.map (
|
|
||||||
host:
|
|
||||||
"${host.config.custom.networking.overlay.address}:${toString host.config.custom.services.recursive-nameserver.port}"
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
implementation = lib.mkOption {
|
implementation = lib.mkOption {
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
client2.wait_for_unit("${client2NetCfg.overlay.systemdUnit}")
|
client2.wait_for_unit("${client2NetCfg.overlay.systemdUnit}")
|
||||||
|
|
||||||
lighthouse.wait_for_unit("unbound.service")
|
lighthouse.wait_for_unit("unbound.service")
|
||||||
lighthouse.wait_for_open_port(53, "${lighthouseNetCfg.overlay.address}")
|
lighthouse.wait_for_open_port(${toString nodes.lighthouse.custom.services.recursive-nameserver.port}, "${lighthouseNetCfg.overlay.address}")
|
||||||
|
|
||||||
server.wait_for_unit("sshd.service")
|
server.wait_for_unit("sshd.service")
|
||||||
client2.wait_for_unit("sshd.service")
|
client2.wait_for_unit("sshd.service")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue