Skip to content

Commit

Permalink
nixos/networkd: add FlowQueuePIE options
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelkuchen6 committed Mar 16, 2023
1 parent 2784862 commit 872a482
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,16 @@ let
(assertInt "PacketLimit")
(assertRange "PacketLimit" 1 4294967294)
];

sectionFlowQueuePIE = checkUnitConfig "FlowQueuePIE" [
(assertOnlyFields [
"Parent"
"Handle"
"PacketLimit"
])
(assertInt "PacketLimit")
(assertRange "PacketLimit" 1 4294967294)
];
};
};

Expand Down Expand Up @@ -1855,6 +1865,17 @@ let
'';
};

flowQueuePIEConfig = mkOption {
default = {};
example = { Parent = "ingress"; PacketLimit = "3847"; };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionFlowQueuePIE;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the
`[FlowQueuePIE]` section of the unit. See
{manpage}`systemd.network(5)` for details.
'';
};

name = mkOption {
type = types.nullOr types.str;
default = null;
Expand Down Expand Up @@ -2302,6 +2323,10 @@ let
[PIE]
${attrsToSection def.pieConfig}
''
+ optionalString (def.flowQueuePIEConfig != { }) ''
[FlowQueuePIE]
${attrsToSection def.flowQueuePIEConfig}
''
+ def.extraConfig;
};

Expand Down

0 comments on commit 872a482

Please sign in to comment.