diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2020-01-31 13:28:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-31 13:28:22 +0100 |
commit | 355b31c98ef400016b6bef38b09117667370e8eb (patch) | |
tree | c12851f88c174ea0e1b94f2e4e715cc4b9f094fc /nixos/modules/system/boot | |
parent | 6ed34f1d299a817159b3cf7162d0c1b1c0bc1342 (diff) | |
parent | a0fd819a4a4a2284bb976ea1b3319d8d1b97132b (diff) | |
download | nixlib-355b31c98ef400016b6bef38b09117667370e8eb.tar nixlib-355b31c98ef400016b6bef38b09117667370e8eb.tar.gz nixlib-355b31c98ef400016b6bef38b09117667370e8eb.tar.bz2 nixlib-355b31c98ef400016b6bef38b09117667370e8eb.tar.lz nixlib-355b31c98ef400016b6bef38b09117667370e8eb.tar.xz nixlib-355b31c98ef400016b6bef38b09117667370e8eb.tar.zst nixlib-355b31c98ef400016b6bef38b09117667370e8eb.zip |
Merge pull request #78476 from Ma27/networkd-vrf-options
nixos/networkd: add vrfConfig option for netdevs, add simple test
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r-- | nixos/modules/system/boot/networkd.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 56a9d6b11380..a684238a2ada 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -55,6 +55,11 @@ let (assertMacAddress "MACAddress") ]; + checkVRF = checkUnitConfig "VRF" [ + (assertOnlyFields [ "Table" ]) + (assertMinimum "Table" 0) + ]; + # 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 # 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 { default = {}; example = { @@ -845,6 +865,11 @@ let ${attrsToSection def.xfrmConfig} ''} + ${optionalString (def.vrfConfig != { }) '' + [VRF] + ${attrsToSection def.vrfConfig} + + ''} ${optionalString (def.wireguardConfig != { }) '' [WireGuard] ${attrsToSection def.wireguardConfig} |