mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
nixos/networkd: add ipv6Prefix
This commit is contained in:
parent
5abd9a74fc
commit
10ad353d8b
1 changed files with 44 additions and 0 deletions
|
@ -324,6 +324,18 @@ let
|
|||
(assertMinimum "DNSLifetimeSec" 0)
|
||||
];
|
||||
|
||||
checkIpv6Prefix = checkUnitConfig "IPv6Prefix" [
|
||||
(assertOnlyFields [
|
||||
"AddressAutoconfiguration" "OnLink" "Prefix"
|
||||
"PreferredLifetimeSec" "ValidLifetimeSec"
|
||||
])
|
||||
(assertValueOneOf "AddressAutoconfiguration" boolValues)
|
||||
(assertValueOneOf "OnLink" boolValues)
|
||||
(assertMinimum "PreferredLifetimeSec" 0)
|
||||
(assertMinimum "ValidLifetimeSec" 0)
|
||||
];
|
||||
|
||||
|
||||
checkDhcpServer = checkUnitConfig "DHCPServer" [
|
||||
(assertOnlyFields [
|
||||
"PoolOffset" "PoolSize" "DefaultLeaseTimeSec" "MaxLeaseTimeSec"
|
||||
|
@ -647,6 +659,22 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
ipv6PrefixOptions = {
|
||||
options = {
|
||||
ipv6PrefixConfig = mkOption {
|
||||
default = {};
|
||||
example = { Prefix = "fd00::/64"; };
|
||||
type = types.addCheck (types.attrsOf unitOption) checkIpv6Prefix;
|
||||
description = ''
|
||||
Each attribute in this set specifies an option in the
|
||||
<literal>[IPv6Prefix]</literal> section of the unit. See
|
||||
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
||||
<manvolnum>5</manvolnum></citerefentry> for details.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
networkOptions = commonNetworkOptions // {
|
||||
|
||||
|
@ -705,6 +733,17 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
ipv6Prefixes = mkOption {
|
||||
default = [];
|
||||
example = { AddressAutoconfiguration = true; OnLink = true; };
|
||||
type = with types; listOf (submodule ipv6PrefixOptions);
|
||||
description = ''
|
||||
A list of ipv6Prefix sections to be added to the unit. See
|
||||
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
||||
<manvolnum>5</manvolnum></citerefentry> for details.
|
||||
'';
|
||||
};
|
||||
|
||||
dhcpServerConfig = mkOption {
|
||||
default = {};
|
||||
example = { PoolOffset = 50; EmitDNS = false; };
|
||||
|
@ -1045,6 +1084,11 @@ let
|
|||
${attrsToSection def.ipv6PrefixDelegationConfig}
|
||||
|
||||
''}
|
||||
${flip concatMapStrings def.ipv6Prefixes (x: ''
|
||||
[IPv6Prefix]
|
||||
${attrsToSection x.ipv6PrefixConfig}
|
||||
|
||||
'')}
|
||||
${optionalString (def.dhcpServerConfig != { }) ''
|
||||
[DHCPServer]
|
||||
${attrsToSection def.dhcpServerConfig}
|
||||
|
|
Loading…
Reference in a new issue