diff options
Diffstat (limited to 'nixos/modules/services/networking/dhcpcd.nix')
-rw-r--r-- | nixos/modules/services/networking/dhcpcd.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/dhcpcd.nix b/nixos/modules/services/networking/dhcpcd.nix index ac5d45a65e3b8..9a0b29fbe5a7f 100644 --- a/nixos/modules/services/networking/dhcpcd.nix +++ b/nixos/modules/services/networking/dhcpcd.nix @@ -33,6 +33,13 @@ let (if !config.networking.useDHCP && enableDHCP then map (i: i.name) (filter (i: i.useDHCP == true) interfaces) else null); + staticIPv6Addresses = map (i: i.name) (filter (i: i.ipv6.addresses != [ ]) interfaces); + + noIPv6rs = concatStringsSep "\n" (map (name: '' + interface ${name} + noipv6rs + '') staticIPv6Addresses); + # Config file adapted from the one that ships with dhcpcd. dhcpcdConf = pkgs.writeText "dhcpcd.conf" '' @@ -75,6 +82,8 @@ let ''} ${cfg.extraConfig} + + ${optionalString config.networking.enableIPv6 noIPv6rs} ''; exitHook = pkgs.writeText "dhcpcd.exit-hook" |