Skip to content

Commit

Permalink
nixos/networkd: add IPoIB options
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelkuchen6 committed Mar 16, 2023
1 parent df14953 commit 09e745c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,15 @@ let
(assertValueOneOf "PresumeAck" boolValues)
(assertValueOneOf "ClassicDataLengthCode" boolValues)
];

sectionIPoIB = checkUnitConfig "IPoIB" [
(assertOnlyFields [
"Mode"
"IgnoreUserspaceMulticastGroup"
])
(assertValueOneOf "Mode" [ "datagram" "connected" ])
(assertValueOneOf "IgnoreUserspaceMulticastGroup" boolValues)
];
};
};

Expand Down Expand Up @@ -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 {
type = types.nullOr types.str;
default = null;
Expand Down Expand Up @@ -2172,6 +2192,10 @@ let
[CAN]
${attrsToSection def.canConfig}
''
+ optionalString (def.ipoIBConfig != { }) ''
[IPoIB]
${attrsToSection def.ipoIBConfig}
''
+ def.extraConfig;
};

Expand Down

0 comments on commit 09e745c

Please sign in to comment.