Skip to content

Commit 24df07c

Browse files
committed
nixos/networkd: add HierarchyTokenBucket options
1 parent 29e5451 commit 24df07c

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

nixos/modules/system/boot/networkd.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,16 @@ let
13611361
"Id"
13621362
])
13631363
];
1364+
1365+
sectionHierarchyTokenBucket = checkUnitConfig "HierarchyTokenBucket" [
1366+
(assertOnlyFields [
1367+
"Parent"
1368+
"Handle"
1369+
"DefaultClass"
1370+
"RateToQuantum"
1371+
])
1372+
(assertInt "RateToQuantum")
1373+
];
13641374
};
13651375
};
13661376

@@ -2249,6 +2259,17 @@ let
22492259
'';
22502260
};
22512261

2262+
hierarchyTokenBucketConfig = mkOption {
2263+
default = {};
2264+
example = { Parent = "root"; };
2265+
type = types.addCheck (types.attrsOf unitOption) check.network.sectionHierarchyTokenBucket;
2266+
description = lib.mdDoc ''
2267+
Each attribute in this set specifies an option in the
2268+
`[HierarchyTokenBucket]` section of the unit. See
2269+
{manpage}`systemd.network(5)` for details.
2270+
'';
2271+
};
2272+
22522273
name = mkOption {
22532274
type = types.nullOr types.str;
22542275
default = null;
@@ -2760,6 +2781,10 @@ let
27602781
[TrivialLinkEqualizer]
27612782
${attrsToSection def.trivialLinkEqualizerConfig}
27622783
''
2784+
+ optionalString (def.hierarchyTokenBucketConfig != { }) ''
2785+
[HierarchyTokenBucket]
2786+
${attrsToSection def.hierarchyTokenBucketConfig}
2787+
''
27632788
+ def.extraConfig;
27642789
};
27652790

0 commit comments

Comments
 (0)