nixos/systemd-networkd: add PREF64 related options

This commit is contained in:
Jared Baur 2024-06-09 12:15:35 -07:00
parent e04560f230
commit b867cc215f
No known key found for this signature in database
2 changed files with 24 additions and 1 deletions

View File

@ -147,7 +147,10 @@ in {
'' + optionalString (def.ipv6SendRAConfig != { }) ''
[IPv6SendRA]
${attrsToSection def.ipv6SendRAConfig}
'' + flip concatMapStrings def.ipv6Prefixes (x: ''
'' + flip concatMapStrings def.ipv6PREF64Prefixes (x: ''
[IPv6PREF64Prefix]
${attrsToSection x}
'') + flip concatMapStrings def.ipv6Prefixes (x: ''
[IPv6Prefix]
${attrsToSection x}
'') + flip concatMapStrings def.ipv6RoutePrefixes (x: ''

View File

@ -952,6 +952,7 @@ let
"UseGateway"
"UseRoutePrefix"
"Token"
"UsePREF64"
])
(assertValueOneOf "UseDNS" boolValues)
(assertValueOneOf "UseDomains" (boolValues ++ ["route"]))
@ -962,6 +963,7 @@ let
(assertValueOneOf "UseMTU" boolValues)
(assertValueOneOf "UseGateway" boolValues)
(assertValueOneOf "UseRoutePrefix" boolValues)
(assertValueOneOf "UsePREF64" boolValues)
];
sectionDHCPServer = checkUnitConfig "DHCPServer" [
@ -1033,6 +1035,14 @@ let
(assertValueOneOf "EmitDomains" boolValues)
];
sectionIPv6PREF64Prefix = checkUnitConfigWithLegacyKey "ipv6PREF64PrefixConfig" "IPv6PREF64Prefix" [
(assertOnlyFields [
"Prefix"
"LifetimeSec"
])
(assertInt "LifetimeSec")
];
sectionIPv6Prefix = checkUnitConfigWithLegacyKey "ipv6PrefixConfig" "IPv6Prefix" [
(assertOnlyFields [
"AddressAutoconfiguration"
@ -2013,6 +2023,16 @@ let
'';
};
ipv6PREF64Prefixes = mkOption {
default = [];
example = [ { Prefix = "64:ff9b::/96"; } ];
type = types.listOf (mkSubsectionType "ipv6PREF64PrefixConfig" check.network.sectionIPv6PREF64Prefix);
description = ''
A list of IPv6PREF64Prefix sections to be added to the unit. See
{manpage}`systemd.network(5)` for details.
'';
};
dhcpServerStaticLeases = mkOption {
default = [];
example = [ { MACAddress = "65:43:4a:5b:d8:5f"; Address = "192.168.1.42"; } ];