nixos-module/container/upstream.nix: setup sched_cake

This commit is contained in:
Astro 2021-04-03 04:31:55 +02:00
parent e9d4f1192f
commit 7615d4d8de
1 changed files with 9 additions and 1 deletions

View File

@ -12,8 +12,16 @@ let
else null; else null;
in in
{ {
systemd.network.networks = builtins.mapAttrs (_: _: { systemd.network.networks = builtins.mapAttrs (_: { upstream, ... }: {
DHCP = "yes"; DHCP = "yes";
extraConfig = ''
[CAKE]
Parent = root
# DOCSIS overhead
OverheadBytes = 18
Bandwidth = ${toString upstream.upBandwidth}K
'';
}) upstreamInterfaces; }) upstreamInterfaces;
networking.nat = lib.optionalAttrs (firstUpstreamInterface != null) { networking.nat = lib.optionalAttrs (firstUpstreamInterface != null) {