nixos/networkd: introduce the DHCPv6 network section eqivalent
You can now specify option for the `[DHCPv6]` section with `systemd.network.<name>.dhcpV6Config.…`. Previously you could only use the combined legacy DHCP configuration.
This commit is contained in:
parent
fc960a0123
commit
bb9b61e2b7
@ -301,6 +301,16 @@ let
|
|||||||
(assertValueOneOf "RapidCommit" boolValues)
|
(assertValueOneOf "RapidCommit" boolValues)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
checkDhcpV6 = checkUnitConfig "DHCPv6" [
|
||||||
|
(assertOnlyFields [
|
||||||
|
"UseDns" "UseNTP" "RapidCommit" "ForceDHCPv6PDOtherInformation"
|
||||||
|
])
|
||||||
|
(assertValueOneOf "UseDNS" boolValues)
|
||||||
|
(assertValueOneOf "UseNTP" boolValues)
|
||||||
|
(assertValueOneOf "RapidCommit" boolValues)
|
||||||
|
(assertValueOneOf "ForceDHCPv6PDOtherInformation" boolValues)
|
||||||
|
];
|
||||||
|
|
||||||
checkDhcpServer = checkUnitConfig "DHCPServer" [
|
checkDhcpServer = checkUnitConfig "DHCPServer" [
|
||||||
(assertOnlyFields [
|
(assertOnlyFields [
|
||||||
"PoolOffset" "PoolSize" "DefaultLeaseTimeSec" "MaxLeaseTimeSec"
|
"PoolOffset" "PoolSize" "DefaultLeaseTimeSec" "MaxLeaseTimeSec"
|
||||||
@ -651,6 +661,18 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
dhcpV6Config = mkOption {
|
||||||
|
default = {};
|
||||||
|
example = { UseDNS = true; UseRoutes = true; };
|
||||||
|
type = types.addCheck (types.attrsOf unitOption) checkDhcpV6;
|
||||||
|
description = ''
|
||||||
|
Each attribute in this set specifies an option in the
|
||||||
|
<literal>[DHCPv6]</literal> section of the unit. See
|
||||||
|
<citerefentry><refentrytitle>systemd.network</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
dhcpServerConfig = mkOption {
|
dhcpServerConfig = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
example = { PoolOffset = 50; EmitDNS = false; };
|
example = { PoolOffset = 50; EmitDNS = false; };
|
||||||
@ -980,6 +1002,11 @@ let
|
|||||||
[DHCP]
|
[DHCP]
|
||||||
${attrsToSection def.dhcpConfig}
|
${attrsToSection def.dhcpConfig}
|
||||||
|
|
||||||
|
''}
|
||||||
|
${optionalString (def.dhcpV6Config != {}) ''
|
||||||
|
[DHCPv6]
|
||||||
|
${attrsToSection def.dhcpV6Config}
|
||||||
|
|
||||||
''}
|
''}
|
||||||
${optionalString (def.dhcpServerConfig != { }) ''
|
${optionalString (def.dhcpServerConfig != { }) ''
|
||||||
[DHCPServer]
|
[DHCPServer]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user