From b5210fa37d2ee5334504676c266f9fd992a89430 Mon Sep 17 00:00:00 2001 From: Astro Date: Fri, 2 Apr 2021 03:09:45 +0200 Subject: [PATCH] options.nix: move domainName --- nix/lib/config/legacy.nix | 2 +- nix/lib/config/options.nix | 8 ++++---- nix/nixos-module/container/dhcp-server.nix | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nix/lib/config/legacy.nix b/nix/lib/config/legacy.nix index f9dd243..7abf78e 100644 --- a/nix/lib/config/legacy.nix +++ b/nix/lib/config/legacy.nix @@ -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; } ] ++ ( diff --git a/nix/lib/config/options.nix b/nix/lib/config/options.nix index 3e5beb8..752c3f9 100644 --- a/nix/lib/config/options.nix +++ b/nix/lib/config/options.nix @@ -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 = { diff --git a/nix/nixos-module/container/dhcp-server.nix b/nix/nixos-module/container/dhcp-server.nix index c379366..2f07d5e 100644 --- a/nix/nixos-module/container/dhcp-server.nix +++ b/nix/nixos-module/container/dhcp-server.nix @@ -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}} {