mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 20:09:07 +01:00
nameservers: Restructure modules
This commit is contained in:
parent
1f2c921b81
commit
2b26c715f2
6 changed files with 10 additions and 10 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
nameservers.overlay.enable = true;
|
private-nameserver.enable = true;
|
||||||
|
|
||||||
syncthing = {
|
syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nameservers.public = {
|
services.public-nameserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
zones = [
|
zones = [
|
||||||
"sprouted.cloud"
|
"sprouted.cloud"
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 = {
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nameservers.overlay.enable = true;
|
services.private-nameserver.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue