mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
htop: let htop program use its default settings
Don't generate the `htoprc` when using default settings to use the defaults of the htop program. Rename the test for this case to 'empty-settings'.
This commit is contained in:
parent
7226c2db46
commit
e4553546cc
3 changed files with 6 additions and 53 deletions
|
@ -96,55 +96,7 @@ in {
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = {
|
default = { };
|
||||||
account_guest_in_cpu_meter = false;
|
|
||||||
color_scheme = 0;
|
|
||||||
cpu_count_from_zero = false;
|
|
||||||
delay = 15;
|
|
||||||
detailed_cpu_time = false;
|
|
||||||
enable_mouse = true;
|
|
||||||
fields = with fields; [
|
|
||||||
PID
|
|
||||||
USER
|
|
||||||
PRIORITY
|
|
||||||
NICE
|
|
||||||
M_SIZE
|
|
||||||
M_RESIDENT
|
|
||||||
M_SHARE
|
|
||||||
STATE
|
|
||||||
PERCENT_CPU
|
|
||||||
PERCENT_MEM
|
|
||||||
TIME
|
|
||||||
COMM
|
|
||||||
];
|
|
||||||
header_margin = true;
|
|
||||||
hide_kernel_threads = true;
|
|
||||||
hide_threads = false;
|
|
||||||
hide_userland_threads = false;
|
|
||||||
highlight_base_name = false;
|
|
||||||
highlight_megabytes = true;
|
|
||||||
highlight_threads = true;
|
|
||||||
shadow_other_users = false;
|
|
||||||
show_cpu_frequency = false;
|
|
||||||
show_cpu_usage = false;
|
|
||||||
show_program_path = true;
|
|
||||||
show_thread_names = false;
|
|
||||||
sort_direction = 1;
|
|
||||||
sort_key = fields.PERCENT_CPU;
|
|
||||||
tree_view = false;
|
|
||||||
update_process_names = false;
|
|
||||||
vim_mode = false;
|
|
||||||
} // (leftMeters [
|
|
||||||
(bar "AllCPUs2")
|
|
||||||
(bar "Memory")
|
|
||||||
(bar "Swap")
|
|
||||||
(text "Zram")
|
|
||||||
]) // (rightMeters [
|
|
||||||
(text "Tasks")
|
|
||||||
(text "LoadAverage")
|
|
||||||
(text "Uptime")
|
|
||||||
(text "Systemd")
|
|
||||||
]);
|
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
color_scheme = 6;
|
color_scheme = 6;
|
||||||
|
@ -193,7 +145,8 @@ in {
|
||||||
|
|
||||||
home.packages = [ pkgs.htop ];
|
home.packages = [ pkgs.htop ];
|
||||||
|
|
||||||
xdg.configFile."htop/htoprc".text =
|
xdg.configFile."htop/htoprc" = mkIf (cfg.settings != { }) {
|
||||||
concatStringsSep "\n" (mapAttrsToList formatOption cfg.settings);
|
text = concatStringsSep "\n" (mapAttrsToList formatOption cfg.settings);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
htop-default-settings = ./default-settings.nix;
|
htop-empty-settings = ./empty-settings.nix;
|
||||||
htop-example-settings = ./example-settings.nix;
|
htop-example-settings = ./example-settings.nix;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ with lib;
|
||||||
programs.htop.enable = true;
|
programs.htop.enable = true;
|
||||||
|
|
||||||
nmt.script = ''
|
nmt.script = ''
|
||||||
assertFileExists home-files/.config/htop/htoprc
|
assertPathNotExists home-files/.config/htop
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Reference in a new issue