diff options
author | Jared Baur <jaredbaur@fastmail.com> | 2022-03-29 07:58:42 -0700 |
---|---|---|
committer | Jared Baur <jaredbaur@fastmail.com> | 2022-03-29 07:58:42 -0700 |
commit | 41e2604483babe9e70429887ff5293aaa8bdb1bb (patch) | |
tree | d87d82820e413442ea509efe9d8b4b980a56fe7e | |
parent | f5054121cb287317c4ca8c409ef9c68f36658013 (diff) |
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 3c4c0069dfd00..49950efc0a1bd 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}" |