From cd650b3fa303a88e6ab842dd110871b50d0bd9d1 Mon Sep 17 00:00:00 2001 From: apfelkuchen06 Date: Tue, 28 Feb 2023 00:06:41 +0100 Subject: [PATCH] nixos/networkd: add QuickFairQueueingClass options --- nixos/modules/system/boot/networkd.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 5c1807578fc7a..c4a40f0fcfc78 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -1403,6 +1403,17 @@ let "Handle" ]) ]; + + sectionQuickFairQueueingClass = checkUnitConfig "QuickFairQueueingClass" [ + (assertOnlyFields [ + "Parent" + "ClassId" + "Weight" + "MaxPacketBytes" + ]) + (assertInt "Weight") + (assertRange "Weight" 1 1023) + ]; }; }; @@ -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; @@ -2862,6 +2884,10 @@ let [QuickFairQueueing] ${attrsToSection def.quickFairQueueingConfig} '' + + optionalString (def.quickFairQueueingConfigClass != { }) '' + [QuickFairQueueingClass] + ${attrsToSection def.quickFairQueueingConfigClass} + '' + def.extraConfig; };