0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

Merge pull request #304117 from ifd3f/systemd-networkd-bridge-config

nixos/networkd: add [Bridge] section to netdev conf
This commit is contained in:
Florian Klink 2024-04-15 18:26:45 +03:00 committed by GitHub
commit 104f0b6183
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 153 additions and 0 deletions

View file

@ -186,6 +186,37 @@ let
(assertNetdevMacAddress "MACAddress")
];
sectionBridge = checkUnitConfig "Bridge" [
(assertOnlyFields [
"HelloTimeSec"
"MaxAgeSec"
"ForwardDelaySec"
"AgeingTimeSec"
"Priority"
"GroupForwardMask"
"DefaultPVID"
"MulticastQuerier"
"MulticastSnooping"
"VLANFiltering"
"VLANProtocol"
"STP"
"MulticastIGMPVersion"
])
(assertInt "HelloTimeSec")
(assertInt "MaxAgeSec")
(assertInt "ForwardDelaySec")
(assertInt "AgeingTimeSec")
(assertRange "Priority" 0 65535)
(assertRange "GroupForwardMask" 0 65535)
(assertRangeOrOneOf "DefaultPVID" 0 4094 ["none"])
(assertValueOneOf "MulticastQuerier" boolValues)
(assertValueOneOf "MulticastSnooping" boolValues)
(assertValueOneOf "VLANFiltering" boolValues)
(assertValueOneOf "VLANProtocol" ["802.1q" "802.ad"])
(assertValueOneOf "STP" boolValues)
(assertValueOneOf "MulticastIGMPVersion" [2 3])
];
sectionVLAN = checkUnitConfig "VLAN" [
(assertOnlyFields [
"Id"
@ -1635,6 +1666,17 @@ let
'';
};
bridgeConfig = mkOption {
default = {};
example = { STP = true; };
type = types.addCheck (types.attrsOf unitOption) check.netdev.sectionBridge;
description = ''
Each attribute in this set specifies an option in the
`[Bridge]` section of the unit. See
{manpage}`systemd.netdev(5)` for details.
'';
};
vlanConfig = mkOption {
default = {};
example = { Id = 4; };