mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
nixos/networkd: add vrfConfig
option to netdevs
This commit is contained in:
parent
21ae4ae879
commit
bc130855a7
1 changed files with 25 additions and 0 deletions
|
@ -55,6 +55,11 @@ let
|
||||||
(assertMacAddress "MACAddress")
|
(assertMacAddress "MACAddress")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
checkVRF = checkUnitConfig "VRF" [
|
||||||
|
(assertOnlyFields [ "Table" ])
|
||||||
|
(assertMinimum "Table" 0)
|
||||||
|
];
|
||||||
|
|
||||||
# NOTE The PrivateKey directive is missing on purpose here, please
|
# NOTE The PrivateKey directive is missing on purpose here, please
|
||||||
# do not add it to this list. The nix store is world-readable let's
|
# do not add it to this list. The nix store is world-readable let's
|
||||||
# refrain ourselves from providing a footgun.
|
# refrain ourselves from providing a footgun.
|
||||||
|
@ -349,6 +354,21 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vrfConfig = mkOption {
|
||||||
|
default = {};
|
||||||
|
example = { Table = 2342; };
|
||||||
|
type = types.addCheck (types.attrsOf unitOption) checkVRF;
|
||||||
|
description = ''
|
||||||
|
Each attribute in this set specifies an option in the
|
||||||
|
<literal>[VRF]</literal> section of the unit. See
|
||||||
|
<citerefentry><refentrytitle>systemd.netdev</refentrytitle>
|
||||||
|
<manvolnum>5</manvolnum></citerefentry> for details.
|
||||||
|
A detailed explanation about how VRFs work can be found in the
|
||||||
|
<link xlink:href="https://www.kernel.org/doc/Documentation/networking/vrf.txt">kernel
|
||||||
|
docs</link>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
wireguardConfig = mkOption {
|
wireguardConfig = mkOption {
|
||||||
default = {};
|
default = {};
|
||||||
example = {
|
example = {
|
||||||
|
@ -844,6 +864,11 @@ let
|
||||||
[Xfrm]
|
[Xfrm]
|
||||||
${attrsToSection def.xfrmConfig}
|
${attrsToSection def.xfrmConfig}
|
||||||
|
|
||||||
|
''}
|
||||||
|
${optionalString (def.vrfConfig != { }) ''
|
||||||
|
[VRF]
|
||||||
|
${attrsToSection def.vrfConfig}
|
||||||
|
|
||||||
''}
|
''}
|
||||||
${optionalString (def.wireguardConfig != { }) ''
|
${optionalString (def.wireguardConfig != { }) ''
|
||||||
[WireGuard]
|
[WireGuard]
|
||||||
|
|
Loading…
Reference in a new issue