nixos/dhcpcd: add IPv6rs option

This commit is contained in:
Izorkin 2023-02-09 14:03:54 +03:00
parent 9448487d9f
commit 3ab26f9f00
No known key found for this signature in database
GPG key ID: 1436C1B3F3679F09
2 changed files with 16 additions and 2 deletions

View file

@ -284,6 +284,7 @@ In addition to numerous new and upgraded packages, this release has the followin
```
- `services.dhcpcd` service now don't solicit or accept IPv6 Router Advertisements on interfaces that use static IPv6 addresses.
If network uses both IPv6 Unique local addresses (ULA) and global IPv6 address auto-configuration with SLAAC, must add the parameter `networking.dhcpcd.IPv6rs = true;`.
- The module `services.headscale` was refactored to be compliant with [RFC 0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md). To be precise, this means that the following things have changed:

View file

@ -81,9 +81,12 @@ let
noipv6
''}
${cfg.extraConfig}
${optionalString (config.networking.enableIPv6 && cfg.IPv6rs == null && staticIPv6Addresses != [ ]) noIPv6rs}
${optionalString (config.networking.enableIPv6 && cfg.IPv6rs == false) ''
noipv6rs
''}
${optionalString config.networking.enableIPv6 noIPv6rs}
${cfg.extraConfig}
'';
exitHook = pkgs.writeText "dhcpcd.exit-hook"
@ -160,6 +163,16 @@ in
'';
};
networking.dhcpcd.IPv6rs = mkOption {
type = types.nullOr types.bool;
default = null;
description = lib.mdDoc ''
Force enable or disable solicitation and receipt of IPv6 Router Advertisements.
This is required, for example, when using a static unique local IPv6 address (ULA)
and global IPv6 address auto-configuration with SLAAC.
'';
};
networking.dhcpcd.runHook = mkOption {
type = types.lines;
default = "";