nixos/networkd: add ControlledDelay options

This commit is contained in:
apfelkuchen06 2023-02-28 00:06:40 +01:00
parent 728108555e
commit 49df6bc669

View File

@ -1257,6 +1257,19 @@ let
(assertValueOneOf "Wash" boolValues)
(assertValueOneOf "SplitGSO" boolValues)
];
sectionControlledDelay = checkUnitConfig "ControlledDelay" [
(assertOnlyFields [
"Parent"
"Handle"
"PacketLimit"
"TargetSec"
"IntervalSec"
"ECN"
"CEThresholdSec"
])
(assertValueOneOf "ECN" boolValues)
];
};
};
@ -2057,6 +2070,17 @@ let
'';
};
controlledDelayConfig = mkOption {
default = {};
example = { Parent = "ingress"; TargetSec = "20msec"; };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionControlledDelay;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the
`[ControlledDelay]` section of the unit. See
{manpage}`systemd.network(5)` for details.
'';
};
name = mkOption {
type = types.nullOr types.str;
default = null;
@ -2536,6 +2560,10 @@ let
[CAKE]
${attrsToSection def.cakeConfig}
''
+ optionalString (def.controlledDelayConfig != { }) ''
[ControlledDelay]
${attrsToSection def.controlledDelayConfig}
''
+ def.extraConfig;
};