Skip to content

Commit

Permalink
nixos/networkd: add BFIFO options
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelkuchen6 committed Mar 16, 2023
1 parent f2ca28f commit d9e1963
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions nixos/modules/system/boot/networkd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,14 @@ let
(assertInt "PerturbPeriodSec")
];

sectionBFIFO = checkUnitConfig "BFIFO" [
(assertOnlyFields [
"Parent"
"Handle"
"LimitBytes"
])
];
};
sectionPFIFO = checkUnitConfig "PFIFO" [
(assertOnlyFields [
"Parent"
Expand Down Expand Up @@ -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"; };
Expand Down Expand Up @@ -2397,6 +2416,10 @@ let
[StochasticFairnessQueueing]
${attrsToSection def.stochasticFairnessQueueingConfig}
''
+ optionalString (def.bfifoConfig != { }) ''
[BFIFO]
${attrsToSection def.bfifoConfig}
''
+ optionalString (def.pfifoConfig != { }) ''
[PFIFO]
${attrsToSection def.pfifoConfig}
Expand Down

0 comments on commit d9e1963

Please sign in to comment.