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:40 +0100
committerapfelkuchen06 <apfelkuchen@hrnz.li>2023-03-16 03:28:23 +0100
commit5b5c79c6a0c94586cc392a1a476397b44912e820 (patch)
tree38902d1cf0c19daea99034e49974e1b9d1becd11 /nixos/modules/system/boot/networkd.nix
parentca496f87548eb194280d2a3a4489380b94d088eb (diff)
downloadnixpkgs-5b5c79c6a0c94586cc392a1a476397b44912e820.tar
nixpkgs-5b5c79c6a0c94586cc392a1a476397b44912e820.tar.gz
nixpkgs-5b5c79c6a0c94586cc392a1a476397b44912e820.tar.bz2
nixpkgs-5b5c79c6a0c94586cc392a1a476397b44912e820.tar.lz
nixpkgs-5b5c79c6a0c94586cc392a1a476397b44912e820.tar.xz
nixpkgs-5b5c79c6a0c94586cc392a1a476397b44912e820.tar.zst
nixpkgs-5b5c79c6a0c94586cc392a1a476397b44912e820.zip
nixos/networkd: add GenericRandomEarlyDetection options
Diffstat (limited to 'nixos/modules/system/boot/networkd.nix')
-rw-r--r--nixos/modules/system/boot/networkd.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix
index 87e70d48a75..886096f067b 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -1300,6 +1300,21 @@ let
         (assertInt "StrictBands")
         (assertRange "StrictBands" 1 16)
       ];
+
+      sectionGenericRandomEarlyDetection = checkUnitConfig "GenericRandomEarlyDetection" [
+        (assertOnlyFields [
+          "Parent"
+          "Handle"
+          "VirtualQueues"
+          "DefaultVirtualQueue"
+          "GenericRIO"
+        ])
+        (assertInt "VirtualQueues")
+        (assertRange "VirtualQueues" 1 16)
+        (assertInt "DefaultVirtualQueue")
+        (assertRange "DefaultVirtualQueue" 1 16)
+        (assertValueOneOf "GenericRIO" boolValues)
+      ];
     };
   };
 
@@ -2144,6 +2159,17 @@ let
       '';
     };
 
+    genericRandomEarlyDetectionConfig = mkOption {
+      default = {};
+      example = { Parent = "root"; VirtualQueues = 5; DefaultVirtualQueue = 3; };
+      type = types.addCheck (types.attrsOf unitOption) check.network.sectionGenericRandomEarlyDetection;
+      description = lib.mdDoc ''
+        Each attribute in this set specifies an option in the
+        `[GenericRandomEarlyDetection]` section of the unit.  See
+        {manpage}`systemd.network(5)` for details.
+      '';
+    };
+
     name = mkOption {
       type = types.nullOr types.str;
       default = null;
@@ -2639,6 +2665,10 @@ let
           [EnhancedTransmissionSelection]
           ${attrsToSection def.enhancedTransmissionSelectionConfig}
         ''
+        + optionalString (def.genericRandomEarlyDetectionConfig != { }) ''
+          [GenericRandomEarlyDetection]
+          ${attrsToSection def.genericRandomEarlyDetectionConfig}
+        ''
         + def.extraConfig;
     };