options.nix: move domainName

This commit is contained in:
Astro 2021-04-02 03:09:45 +02:00
parent 5023f0a2df
commit b5210fa37d
3 changed files with 7 additions and 7 deletions

View File

@ -42,8 +42,8 @@ in
then dhcpData.fixed-hosts
else {};
router = dhcpData.host-opts.routers;
domainName = dhcpData.string-opts.domain-name;
};
domainName = dhcpData.string-opts.domain-name;
}) pillar.dhcp)
{ core.ospf.secret = pillar.ospf.secret; }
] ++ (

View File

@ -27,10 +27,6 @@ let
description = "Gateway";
type = types.str;
};
domainName = mkOption {
description = "Domain name option";
type = types.str;
};
fixed-hosts = mkOption {
type = with types; attrsOf str;
default = {};
@ -94,6 +90,10 @@ let
type = with types; nullOr (submodule { options = dhcpOpts; });
default = null;
};
domainName = mkOption {
description = "Domain name option";
type = types.str;
};
};
};
upstreamOpts = {

View File

@ -18,13 +18,13 @@ in
extraConfig = ''
${builtins.concatStringsSep "\n" (
builtins.attrValues (
builtins.mapAttrs (net: { dhcp, subnet4Net, subnet4Len, ...}:
builtins.mapAttrs (net: { dhcp, subnet4Net, subnet4Len, domainName, ...}:
''
group {
default-lease-time ${toString dhcp.time};
max-lease-time ${toString dhcp.max-time};
option routers ${config.site.net.${net}.hosts4.${builtins.replaceStrings [".${net}"] [""] dhcp.router}};
option domain-name "${dhcp.domainName}";
option domain-name "${domainName}";
option domain-name-servers 172.20.73.8, 9.9.9.9;
subnet ${subnet4Net} netmask ${lib.netmasks.${toString subnet4Len}} {