home: i3bar: display network throughput

This commit is contained in:
Antoine Martin 2021-08-10 02:48:21 +02:00
parent 1b7c4d40c6
commit 64c53c243d

View file

@ -16,6 +16,12 @@ in
example = ["Core 0" "Core 1" "Core 2" "Core 3"];
default = "";
};
networking.throughput_interfaces = mkOption {
type = types.listOf types.str;
example = [ "wlp1s0" ];
default = [ ];
};
};
config = lib.mkIf isEnabled {
@ -73,6 +79,18 @@ in
chip = cfg.temperature.chip;
inputs = cfg.temperature.inputs;
}
] ++ (lib.lists.optionals ((builtins.length cfg.networking.throughput_interfaces) != 0)
(map
(interface:
{
block = "net";
device = interface;
interval = 1;
hide_inactive = true;
})
cfg.networking.throughput_interfaces)
) ++ [
{
block = "networkmanager";
primary_only = true;