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

nixos/networkd: add IPoIB options

This commit is contained in:
apfelkuchen06 2023-02-28 00:06:39 +01:00
parent df14953724
commit 09e745c784

View file

@ -1088,6 +1088,15 @@ let
(assertValueOneOf "PresumeAck" boolValues) (assertValueOneOf "PresumeAck" boolValues)
(assertValueOneOf "ClassicDataLengthCode" boolValues) (assertValueOneOf "ClassicDataLengthCode" boolValues)
]; ];
sectionIPoIB = checkUnitConfig "IPoIB" [
(assertOnlyFields [
"Mode"
"IgnoreUserspaceMulticastGroup"
])
(assertValueOneOf "Mode" [ "datagram" "connected" ])
(assertValueOneOf "IgnoreUserspaceMulticastGroup" boolValues)
];
}; };
}; };
@ -1745,6 +1754,17 @@ let
''; '';
}; };
ipoIBConfig = mkOption {
default = {};
example = { };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionIPoIB;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the
`[IPoIB]` section of the unit. See
{manpage}`systemd.network(5)` for details.
'';
};
name = mkOption { name = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
@ -2172,6 +2192,10 @@ let
[CAN] [CAN]
${attrsToSection def.canConfig} ${attrsToSection def.canConfig}
'' ''
+ optionalString (def.ipoIBConfig != { }) ''
[IPoIB]
${attrsToSection def.ipoIBConfig}
''
+ def.extraConfig; + def.extraConfig;
}; };