Skip to content

Commit

Permalink
nixos/networkd: add StochasticFairnessQueueing options
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelkuchen6 committed Mar 16, 2023
1 parent 736650c commit 51689e8
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 @@ -1163,6 +1163,15 @@ let
(assertInt "PacketLimit")
(assertRange "PacketLimit" 1 4294967294)
];

sectionStochasticFairnessQueueing = checkUnitConfig "StochasticFairnessQueueing" [
(assertOnlyFields [
"Parent"
"Handle"
"PerturbPeriodSec"
])
(assertInt "PerturbPeriodSec")
];
};
};

Expand Down Expand Up @@ -1897,6 +1906,17 @@ let
'';
};

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

name = mkOption {
type = types.nullOr types.str;
default = null;
Expand Down Expand Up @@ -2352,6 +2372,10 @@ let
[StochasticFairBlue]
${attrsToSection def.stochasticFairBlueConfig}
''
+ optionalString (def.stochasticFairnessQueueingConfig != { }) ''
[StochasticFairnessQueueing]
${attrsToSection def.stochasticFairnessQueueingConfig}
''
+ def.extraConfig;
};

Expand Down

0 comments on commit 51689e8

Please sign in to comment.