Skip to content

Commit

Permalink
nixos/networkd: add DeficitRoundRobinSchedulerClass options
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelkuchen6 committed Mar 16, 2023
1 parent 0d06e85 commit 3cde7aa
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,14 @@ let
"Handle"
])
];

sectionDeficitRoundRobinSchedulerClass = checkUnitConfig "DeficitRoundRobinSchedulerClass" [
(assertOnlyFields [
"Parent"
"Handle"
"QuantumBytes"
])
];
};
};

Expand Down Expand Up @@ -2099,6 +2107,17 @@ let
'';
};

deficitRoundRobinSchedulerClassConfig = mkOption {
default = {};
example = { Parent = "root"; QuantumBytes = "300k"; };
type = types.addCheck (types.attrsOf unitOption) check.network.sectionDeficitRoundRobinSchedulerClass;
description = lib.mdDoc ''
Each attribute in this set specifies an option in the
`[DeficitRoundRobinSchedulerClass]` section of the unit. See
{manpage}`systemd.network(5)` for details.
'';
};

name = mkOption {
type = types.nullOr types.str;
default = null;
Expand Down Expand Up @@ -2586,6 +2605,10 @@ let
[DeficitRoundRobinScheduler]
${attrsToSection def.deficitRoundRobinSchedulerConfig}
''
+ optionalString (def.deficitRoundRobinSchedulerClassConfig != { }) ''
[DeficitRoundRobinSchedulerClass]
${attrsToSection def.deficitRoundRobinSchedulerClassConfig}
''
+ def.extraConfig;
};

Expand Down

0 comments on commit 3cde7aa

Please sign in to comment.