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