nameservers: Restructure modules

This commit is contained in:
SebastianStork 2026-03-02 01:49:08 +01:00
parent 1f2c921b81
commit 2b26c715f2
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
6 changed files with 10 additions and 10 deletions

View file

@ -21,7 +21,7 @@
}; };
services = { services = {
nameservers.overlay.enable = true; private-nameserver.enable = true;
syncthing = { syncthing = {
enable = true; enable = true;

View file

@ -21,7 +21,7 @@
}; };
}; };
services.nameservers.public = { services.public-nameserver = {
enable = true; enable = true;
zones = [ zones = [
"sprouted.cloud" "sprouted.cloud"

View file

@ -63,7 +63,7 @@ in
default = default =
allHosts allHosts
|> lib.attrValues |> lib.attrValues
|> lib.filter (host: host.config.custom.services.nameservers.overlay.enable) |> lib.filter (host: host.config.custom.services.private-nameserver.enable)
|> lib.map (host: host.config.custom.networking.overlay.address); |> lib.map (host: host.config.custom.networking.overlay.address);
}; };

View file

@ -7,7 +7,7 @@
... ...
}: }:
let let
cfg = config.custom.services.nameservers.overlay; cfg = config.custom.services.private-nameserver;
netCfg = config.custom.networking; netCfg = config.custom.networking;
zoneData = inputs.dns.lib.toString netCfg.overlay.domain { zoneData = inputs.dns.lib.toString netCfg.overlay.domain {
@ -20,7 +20,7 @@ let
NS = NS =
allHosts allHosts
|> lib.attrValues |> lib.attrValues
|> lib.filter (host: host.config.custom.services.nameservers.overlay.enable) |> lib.filter (host: host.config.custom.services.private-nameserver.enable)
|> lib.map (host: "${host.config.custom.networking.overlay.fqdn}."); |> lib.map (host: "${host.config.custom.networking.overlay.fqdn}.");
subdomains = subdomains =
@ -58,7 +58,7 @@ let
}; };
in in
{ {
options.custom.services.nameservers.overlay.enable = lib.mkEnableOption ""; options.custom.services.private-nameserver.enable = lib.mkEnableOption "";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services = { services = {

View file

@ -6,7 +6,7 @@
... ...
}: }:
let let
cfg = config.custom.services.nameservers.public; cfg = config.custom.services.public-nameserver;
netCfg = config.custom.networking; netCfg = config.custom.networking;
zoneData = zoneData =
@ -38,7 +38,7 @@ let
nsRecords = nsRecords =
allHosts allHosts
|> lib.attrValues |> lib.attrValues
|> lib.filter (host: host.config.custom.services.nameservers.public.enable) |> lib.filter (host: host.config.custom.services.public-nameserver.enable)
|> lib.map (host: { |> lib.map (host: {
name = host.config.custom.networking.hostName; name = host.config.custom.networking.hostName;
inherit (host.config.custom.networking.underlay) address; inherit (host.config.custom.networking.underlay) address;
@ -64,7 +64,7 @@ let
}; };
in in
{ {
options.custom.services.nameservers.public = { options.custom.services.public-nameserver = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
zones = lib.mkOption { zones = lib.mkOption {
type = lib.types.nonEmptyListOf lib.types.nonEmptyStr; type = lib.types.nonEmptyListOf lib.types.nonEmptyStr;

View file

@ -58,7 +58,7 @@
}; };
}; };
services.nameservers.overlay.enable = true; services.private-nameserver.enable = true;
}; };
}; };