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:22 +0100
commitd9e1963a158f38b95a21171a0ed400a2c2575b7a (patch)
treede1a5741786cca62cefa3f02bc62a02ca8fe138c /nixos/modules/system/boot/networkd.nix
parentf2ca28f6585a3ecad3032e8057ea606402a86e93 (diff)
downloadnixpkgs-d9e1963a158f38b95a21171a0ed400a2c2575b7a.tar
nixpkgs-d9e1963a158f38b95a21171a0ed400a2c2575b7a.tar.gz
nixpkgs-d9e1963a158f38b95a21171a0ed400a2c2575b7a.tar.bz2
nixpkgs-d9e1963a158f38b95a21171a0ed400a2c2575b7a.tar.lz
nixpkgs-d9e1963a158f38b95a21171a0ed400a2c2575b7a.tar.xz
nixpkgs-d9e1963a158f38b95a21171a0ed400a2c2575b7a.tar.zst
nixpkgs-d9e1963a158f38b95a21171a0ed400a2c2575b7a.zip
nixos/networkd: add BFIFO 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 21dc14be511..99c72e84519 100644
--- a/nixos/modules/system/boot/networkd.nix
+++ b/nixos/modules/system/boot/networkd.nix
@@ -1173,6 +1173,14 @@ let
         (assertInt "PerturbPeriodSec")
       ];
 
+      sectionBFIFO = checkUnitConfig "BFIFO" [
+        (assertOnlyFields [
+          "Parent"
+          "Handle"
+          "LimitBytes"
+        ])
+      ];
+    };
       sectionPFIFO = checkUnitConfig "PFIFO" [
         (assertOnlyFields [
           "Parent"
@@ -1927,6 +1935,17 @@ let
       '';
     };
 
+    bfifoConfig = mkOption {
+      default = {};
+      example = { Parent = "ingress"; LimitBytes = "20K"; };
+      type = types.addCheck (types.attrsOf unitOption) check.network.sectionBFIFO;
+      description = lib.mdDoc ''
+        Each attribute in this set specifies an option in the
+        `[BFIFO]` section of the unit.  See
+        {manpage}`systemd.network(5)` for details.
+      '';
+    };
+
     pfifoConfig = mkOption {
       default = {};
       example = { Parent = "ingress"; PacketLimit = "300"; };
@@ -2397,6 +2416,10 @@ let
           [StochasticFairnessQueueing]
           ${attrsToSection def.stochasticFairnessQueueingConfig}
         ''
+        + optionalString (def.bfifoConfig != { }) ''
+          [BFIFO]
+          ${attrsToSection def.bfifoConfig}
+        ''
         + optionalString (def.pfifoConfig != { }) ''
           [PFIFO]
           ${attrsToSection def.pfifoConfig}