Skip to content

Commit 09e745c

Browse files
committed
nixos/networkd: add IPoIB options
1 parent df14953 commit 09e745c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

nixos/modules/system/boot/networkd.nix

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,15 @@ let
10881088
(assertValueOneOf "PresumeAck" boolValues)
10891089
(assertValueOneOf "ClassicDataLengthCode" boolValues)
10901090
];
1091+
1092+
sectionIPoIB = checkUnitConfig "IPoIB" [
1093+
(assertOnlyFields [
1094+
"Mode"
1095+
"IgnoreUserspaceMulticastGroup"
1096+
])
1097+
(assertValueOneOf "Mode" [ "datagram" "connected" ])
1098+
(assertValueOneOf "IgnoreUserspaceMulticastGroup" boolValues)
1099+
];
10911100
};
10921101
};
10931102

@@ -1745,6 +1754,17 @@ let
17451754
'';
17461755
};
17471756

1757+
ipoIBConfig = mkOption {
1758+
default = {};
1759+
example = { };
1760+
type = types.addCheck (types.attrsOf unitOption) check.network.sectionIPoIB;
1761+
description = lib.mdDoc ''
1762+
Each attribute in this set specifies an option in the
1763+
`[IPoIB]` section of the unit. See
1764+
{manpage}`systemd.network(5)` for details.
1765+
'';
1766+
};
1767+
17481768
name = mkOption {
17491769
type = types.nullOr types.str;
17501770
default = null;
@@ -2172,6 +2192,10 @@ let
21722192
[CAN]
21732193
${attrsToSection def.canConfig}
21742194
''
2195+
+ optionalString (def.ipoIBConfig != { }) ''
2196+
[IPoIB]
2197+
${attrsToSection def.ipoIBConfig}
2198+
''
21752199
+ def.extraConfig;
21762200
};
21772201

0 commit comments

Comments
 (0)