lol

nixos/networkd: add [IPVLAN] and [IPVTAP] configuration options to systemd.netdev files

[IPVLAN](https://www.freedesktop.org/software/systemd/man/latest/systemd.netdev.html#%5BIPVLAN%5D%20Section%20Options)
[IPVTAP](https://www.freedesktop.org/software/systemd/man/latest/systemd.netdev.html#%5BIPVTAP%5D%20Section%20Options)

authored by philiptaron.tngl.sh and committed by

Jörg Thalheim bc7a939c 7686f246

+40
+6
nixos/lib/systemd-network-units.nix
··· 23 23 '' + optionalString (def.vlanConfig != { }) '' 24 24 [VLAN] 25 25 ${attrsToSection def.vlanConfig} 26 + '' + optionalString (def.ipvlanConfig != { }) '' 27 + [IPVLAN] 28 + ${attrsToSection def.ipvlanConfig} 29 + '' + optionalString (def.ipvtapConfig != { }) '' 30 + [IPVTAP] 31 + ${attrsToSection def.ipvtapConfig} 26 32 '' + optionalString (def.macvlanConfig != { }) '' 27 33 [MACVLAN] 28 34 ${attrsToSection def.macvlanConfig}
+34
nixos/modules/system/boot/networkd.nix
··· 122 122 (assertValueOneOf "PacketInfo" boolValues) 123 123 (assertValueOneOf "VNetHeader" boolValues) 124 124 ]; 125 + 126 + # See https://www.freedesktop.org/software/systemd/man/latest/systemd.netdev.html#%5BIPVTAP%5D%20Section%20Options 127 + ipVlanVtapChecks = [ 128 + (assertOnlyFields [ 129 + "Mode" 130 + "Flags" 131 + ]) 132 + (assertValueOneOf "Mode" ["L2" "L3" "L3S" ]) 133 + (assertValueOneOf "Flags" ["private" "vepa" "bridge" ]) 134 + ]; 125 135 in { 126 136 127 137 sectionNetdev = checkUnitConfig "Netdev" [ ··· 191 201 (assertValueOneOf "LooseBinding" boolValues) 192 202 (assertValueOneOf "ReorderHeader" boolValues) 193 203 ]; 204 + 205 + sectionIPVLAN = checkUnitConfig "IPVLAN" ipVlanVtapChecks; 206 + 207 + sectionIPVTAP = checkUnitConfig "IPVTAP" ipVlanVtapChecks; 194 208 195 209 sectionMACVLAN = checkUnitConfig "MACVLAN" [ 196 210 (assertOnlyFields [ ··· 1622 1636 Each attribute in this set specifies an option in the 1623 1637 `[VLAN]` section of the unit. See 1624 1638 {manpage}`systemd.netdev(5)` for details. 1639 + ''; 1640 + }; 1641 + 1642 + ipvlanConfig = mkOption { 1643 + default = {}; 1644 + example = { Mode = "L2"; Flags = "private"; }; 1645 + type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionIPVLAN; 1646 + description = lib.mdDoc '' 1647 + Each attribute in this set specifies an option in the `[IPVLAN]` section of the unit. 1648 + See {manpage}`systemd.netdev(5)` for details. 1649 + ''; 1650 + }; 1651 + 1652 + ipvtapConfig = mkOption { 1653 + default = {}; 1654 + example = { Mode = "L3"; Flags = "vepa"; }; 1655 + type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionIPVTAP; 1656 + description = lib.mdDoc '' 1657 + Each attribute in this set specifies an option in the `[IPVTAP]` section of the unit. 1658 + See {manpage}`systemd.netdev(5)` for details. 1625 1659 ''; 1626 1660 }; 1627 1661