diff options
author | Michele Guerini Rocco <rnhmjoj@users.noreply.github.com> | 2022-03-29 21:34:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 21:34:41 +0200 |
commit | 18071b3d1a288b1fe8bf089d6d52afcb0b00029b (patch) | |
tree | f989b46c0e4eb55efbc44da752b6ad1beb1af1a3 | |
parent | 8e556cdb48cda0ad35df0a62c2b99983825695b3 (diff) | |
parent | 41e2604483babe9e70429887ff5293aaa8bdb1bb (diff) | |
download | nixlib-18071b3d1a288b1fe8bf089d6d52afcb0b00029b.tar nixlib-18071b3d1a288b1fe8bf089d6d52afcb0b00029b.tar.gz nixlib-18071b3d1a288b1fe8bf089d6d52afcb0b00029b.tar.bz2 nixlib-18071b3d1a288b1fe8bf089d6d52afcb0b00029b.tar.lz nixlib-18071b3d1a288b1fe8bf089d6d52afcb0b00029b.tar.xz nixlib-18071b3d1a288b1fe8bf089d6d52afcb0b00029b.tar.zst nixlib-18071b3d1a288b1fe8bf089d6d52afcb0b00029b.zip |
Merge pull request #166189 from jmbaur/dhcpd6-reserved-addresses
nixos/dhcpd6: Use fixed-address6 for dhcpd6 address reservations
-rw-r--r-- | nixos/modules/services/networking/dhcpd.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/dhcpd.nix b/nixos/modules/services/networking/dhcpd.nix index 3c4c0069dfd0..49950efc0a1b 100644 --- a/nixos/modules/services/networking/dhcpd.nix +++ b/nixos/modules/services/networking/dhcpd.nix @@ -7,7 +7,7 @@ let cfg4 = config.services.dhcpd4; cfg6 = config.services.dhcpd6; - writeConfig = cfg: pkgs.writeText "dhcpd.conf" + writeConfig = postfix: cfg: pkgs.writeText "dhcpd.conf" '' default-lease-time 600; max-lease-time 7200; @@ -21,7 +21,9 @@ let (machine: '' host ${machine.hostName} { hardware ethernet ${machine.ethernetAddress}; - fixed-address ${machine.ipAddress}; + fixed-address${ + optionalString (postfix == "6") postfix + } ${machine.ipAddress}; } '') cfg.machines @@ -33,7 +35,7 @@ let configFile = if cfg.configFile != null then cfg.configFile - else writeConfig cfg; + else writeConfig postfix cfg; leaseFile = "/var/lib/dhcpd${postfix}/dhcpd.leases"; args = [ "@${pkgs.dhcp}/sbin/dhcpd" "dhcpd${postfix}" "-${postfix}" |