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 != { }) '' '' + optionalString (def.ipv6SendRAConfig != { }) ''
[IPv6SendRA] [IPv6SendRA]
${attrsToSection def.ipv6SendRAConfig} ${attrsToSection def.ipv6SendRAConfig}
'' + flip concatMapStrings def.ipv6Prefixes (x: '' '' + flip concatMapStrings def.ipv6PREF64Prefixes (x: ''
[IPv6PREF64Prefix]
${attrsToSection x}
'') + flip concatMapStrings def.ipv6Prefixes (x: ''
[IPv6Prefix] [IPv6Prefix]
${attrsToSection x} ${attrsToSection x}
'') + flip concatMapStrings def.ipv6RoutePrefixes (x: '' '') + flip concatMapStrings def.ipv6RoutePrefixes (x: ''

View File

@ -952,6 +952,7 @@ let
"UseGateway" "UseGateway"
"UseRoutePrefix" "UseRoutePrefix"
"Token" "Token"
"UsePREF64"
]) ])
(assertValueOneOf "UseDNS" boolValues) (assertValueOneOf "UseDNS" boolValues)
(assertValueOneOf "UseDomains" (boolValues ++ ["route"])) (assertValueOneOf "UseDomains" (boolValues ++ ["route"]))
@ -962,6 +963,7 @@ let
(assertValueOneOf "UseMTU" boolValues) (assertValueOneOf "UseMTU" boolValues)
(assertValueOneOf "UseGateway" boolValues) (assertValueOneOf "UseGateway" boolValues)
(assertValueOneOf "UseRoutePrefix" boolValues) (assertValueOneOf "UseRoutePrefix" boolValues)
(assertValueOneOf "UsePREF64" boolValues)
]; ];
sectionDHCPServer = checkUnitConfig "DHCPServer" [ sectionDHCPServer = checkUnitConfig "DHCPServer" [
@ -1033,6 +1035,14 @@ let
(assertValueOneOf "EmitDomains" boolValues) (assertValueOneOf "EmitDomains" boolValues)
]; ];
sectionIPv6PREF64Prefix = checkUnitConfigWithLegacyKey "ipv6PREF64PrefixConfig" "IPv6PREF64Prefix" [
(assertOnlyFields [
"Prefix"
"LifetimeSec"
])
(assertInt "LifetimeSec")
];
sectionIPv6Prefix = checkUnitConfigWithLegacyKey "ipv6PrefixConfig" "IPv6Prefix" [ sectionIPv6Prefix = checkUnitConfigWithLegacyKey "ipv6PrefixConfig" "IPv6Prefix" [
(assertOnlyFields [ (assertOnlyFields [
"AddressAutoconfiguration" "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 { dhcpServerStaticLeases = mkOption {
default = []; default = [];
example = [ { MACAddress = "65:43:4a:5b:d8:5f"; Address = "192.168.1.42"; } ]; example = [ { MACAddress = "65:43:4a:5b:d8:5f"; Address = "192.168.1.42"; } ];