From b08e5be98d9eed403a2f334f2459da909114c002 Mon Sep 17 00:00:00 2001 From: apfelkuchen06 Date: Tue, 28 Feb 2023 00:06:39 +0100 Subject: [PATCH] nixos/networkd: add QDisc options --- nixos/modules/system/boot/networkd.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 371c4cb4b9c8..905ddf06e99e 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -1097,6 +1097,14 @@ let (assertValueOneOf "Mode" [ "datagram" "connected" ]) (assertValueOneOf "IgnoreUserspaceMulticastGroup" boolValues) ]; + + sectionQDisc = checkUnitConfig "QDisc" [ + (assertOnlyFields [ + "Parent" + "Handle" + ]) + (assertValueOneOf "Parent" [ "clsact" "ingress" ]) + ]; }; }; @@ -1765,6 +1773,17 @@ let ''; }; + qdiscConfig = mkOption { + default = {}; + example = { Parent = "ingress"; }; + type = types.addCheck (types.attrsOf unitOption) check.network.sectionQDisc; + description = lib.mdDoc '' + Each attribute in this set specifies an option in the + `[QDisc]` section of the unit. See + {manpage}`systemd.network(5)` for details. + ''; + }; + name = mkOption { type = types.nullOr types.str; default = null; @@ -2196,6 +2215,10 @@ let [IPoIB] ${attrsToSection def.ipoIBConfig} '' + + optionalString (def.qdiscConfig != { }) '' + [QDisc] + ${attrsToSection def.qdiscConfig} + '' + def.extraConfig; };