nixos/networkd: add PFIFO options

This commit is contained in:
apfelkuchen06 2023-02-28 00:06:40 +01:00
parent 51689e86b9
commit f2ca28f658

View file

@ -1172,6 +1172,16 @@ let
]) ])
(assertInt "PerturbPeriodSec") (assertInt "PerturbPeriodSec")
]; ];
sectionPFIFO = checkUnitConfig "PFIFO" [
(assertOnlyFields [
"Parent"
"Handle"
"PacketLimit"
])
(assertInt "PacketLimit")
(assertRange "PacketLimit" 0 4294967294)
];
}; };
}; };
@ -1917,6 +1927,17 @@ let
''; '';
}; };
pfifoConfig = mkOption {
default = {};
example = { Parent = "ingress"; PacketLimit = "300"; };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionPFIFO;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the
`[PFIFO]` 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;
@ -2376,6 +2397,10 @@ let
[StochasticFairnessQueueing] [StochasticFairnessQueueing]
${attrsToSection def.stochasticFairnessQueueingConfig} ${attrsToSection def.stochasticFairnessQueueingConfig}
'' ''
+ optionalString (def.pfifoConfig != { }) ''
[PFIFO]
${attrsToSection def.pfifoConfig}
''
+ def.extraConfig; + def.extraConfig;
}; };