Skip to content

Commit

Permalink
nixos/networkd: add PFIFOFast options
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelkuchen6 committed Mar 16, 2023
1 parent f75ec30 commit 7a6cae0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,13 @@ let
(assertInt "PacketLimit")
(assertRange "PacketLimit" 0 4294967294)
];

sectionPFIFOFast = checkUnitConfig "PFIFOFast" [
(assertOnlyFields [
"Parent"
"Handle"
])
];
};
};

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -2449,6 +2467,10 @@ let
[PFIFOHeadDrop]
${attrsToSection def.pfifoHeadDropConfig}
''
+ optionalString (def.pfifoFastConfig != { }) ''
[PFIFOFast]
${attrsToSection def.pfifoFastConfig}
''
+ def.extraConfig;
};

Expand Down

0 comments on commit 7a6cae0

Please sign in to comment.