nixos-configs/modules/desktop/htop.nix

62 lines
1.3 KiB
Nix
Raw Normal View History

2024-08-20 22:58:24 +02:00
{
config,
lib,
pkgs,
...
}:
2023-03-21 10:37:27 +01:00
2024-08-20 22:58:24 +02:00
let
cfg = config.modules.desktop.htop;
in
{
options.modules.desktop.htop = {
enable = lib.my.mkBoolOpt false;
};
config = lib.mkIf cfg.enable {
home-manager.users.${config.user.name} =
{ config, ... }:
{
programs.htop = {
enable = true;
package = pkgs.htop-vim;
settings =
{
hide_userland_threads = true;
highlight_base_name = true;
vim_mode = true;
fields = with config.lib.htop.fields; [
PID
USER
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
IO_RATE
TIME
COMM
];
}
// (
with config.lib.htop;
leftMeters [
(bar "LeftCPUs2")
(bar "CPU")
(bar "Memory")
(bar "Swap")
]
)
// (
with config.lib.htop;
rightMeters [
(bar "RightCPUs2")
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
]
);
};
2023-03-21 10:37:27 +01:00
};
};
}