Skip to content

Commit

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

sectionQuickFairQueueingClass = checkUnitConfig "QuickFairQueueingClass" [
(assertOnlyFields [
"Parent"
"ClassId"
"Weight"
"MaxPacketBytes"
])
(assertInt "Weight")
(assertRange "Weight" 1 1023)
];
};
};

Expand Down Expand Up @@ -2335,6 +2346,17 @@ let
'';
};

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

name = mkOption {
type = types.nullOr types.str;
default = null;
Expand Down Expand Up @@ -2862,6 +2884,10 @@ let
[QuickFairQueueing]
${attrsToSection def.quickFairQueueingConfig}
''
+ optionalString (def.quickFairQueueingConfigClass != { }) ''
[QuickFairQueueingClass]
${attrsToSection def.quickFairQueueingConfigClass}
''
+ def.extraConfig;
};

Expand Down

0 comments on commit cd650b3

Please sign in to comment.