summary refs log tree commit diff
path: root/nixos/modules/system/boot/networkd.nix
diff options
context:
space:
mode:
authorapfelkuchen06 <apfelkuchen@hrnz.li>2023-02-28 00:06:39 +0100
committerapfelkuchen06 <apfelkuchen@hrnz.li>2023-03-16 03:28:21 +0100
commitb08e5be98d9eed403a2f334f2459da909114c002 (patch)
tree8e769b4456be8d7e90fa63b6df3881bdc11171b7 /nixos/modules/system/boot/networkd.nix
parent09e745c78405cbd906f8f39cc89376f9f29db1c3 (diff)
downloadnixpkgs-b08e5be98d9eed403a2f334f2459da909114c002.tar
nixpkgs-b08e5be98d9eed403a2f334f2459da909114c002.tar.gz
nixpkgs-b08e5be98d9eed403a2f334f2459da909114c002.tar.bz2
nixpkgs-b08e5be98d9eed403a2f334f2459da909114c002.tar.lz
nixpkgs-b08e5be98d9eed403a2f334f2459da909114c002.tar.xz
nixpkgs-b08e5be98d9eed403a2f334f2459da909114c002.tar.zst
nixpkgs-b08e5be98d9eed403a2f334f2459da909114c002.zip
nixos/networkd: add QDisc options
Diffstat (limited to 'nixos/modules/system/boot/networkd.nix')
-rw-r--r--nixos/modules/system/boot/networkd.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index 371c4cb4b9c..905ddf06e99 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;
     };