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

nixos/networkd: add FlowQueuePIE options

This commit is contained in:
apfelkuchen06 2023-02-28 00:06:39 +01:00
parent 2784862e41
commit 872a4823cf

View file

@ -1143,6 +1143,16 @@ let
(assertInt "PacketLimit") (assertInt "PacketLimit")
(assertRange "PacketLimit" 1 4294967294) (assertRange "PacketLimit" 1 4294967294)
]; ];
sectionFlowQueuePIE = checkUnitConfig "FlowQueuePIE" [
(assertOnlyFields [
"Parent"
"Handle"
"PacketLimit"
])
(assertInt "PacketLimit")
(assertRange "PacketLimit" 1 4294967294)
];
}; };
}; };
@ -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 { name = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
@ -2302,6 +2323,10 @@ let
[PIE] [PIE]
${attrsToSection def.pieConfig} ${attrsToSection def.pieConfig}
'' ''
+ optionalString (def.flowQueuePIEConfig != { }) ''
[FlowQueuePIE]
${attrsToSection def.flowQueuePIEConfig}
''
+ def.extraConfig; + def.extraConfig;
}; };