From 7a6cae0e155ec8952fcaa0add1b6f6d712e8d721 Mon Sep 17 00:00:00 2001 From: apfelkuchen06 Date: Tue, 28 Feb 2023 00:06:40 +0100 Subject: [PATCH] nixos/networkd: add PFIFOFast options --- nixos/modules/system/boot/networkd.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nixos/modules/system/boot/networkd.nix b/nixos/modules/system/boot/networkd.nix index 4516c481bff5..00d32083378b 100644 --- a/nixos/modules/system/boot/networkd.nix +++ b/nixos/modules/system/boot/networkd.nix @@ -1200,6 +1200,13 @@ let (assertInt "PacketLimit") (assertRange "PacketLimit" 0 4294967294) ]; + + sectionPFIFOFast = checkUnitConfig "PFIFOFast" [ + (assertOnlyFields [ + "Parent" + "Handle" + ]) + ]; }; }; @@ -1978,6 +1985,17 @@ let ''; }; + pfifoFastConfig = mkOption { + default = {}; + example = { Parent = "ingress"; }; + type = types.addCheck (types.attrsOf unitOption) check.network.sectionPFIFOFast; + description = lib.mdDoc '' + Each attribute in this set specifies an option in the + `[PFIFOFast]` section of the unit. See + {manpage}`systemd.network(5)` for details. + ''; + }; + name = mkOption { type = types.nullOr types.str; default = null; @@ -2449,6 +2467,10 @@ let [PFIFOHeadDrop] ${attrsToSection def.pfifoHeadDropConfig} '' + + optionalString (def.pfifoFastConfig != { }) '' + [PFIFOFast] + ${attrsToSection def.pfifoFastConfig} + '' + def.extraConfig; };