2021-11-01 20:27:29 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
config = with config.lib.htop; {
|
|
|
|
programs.htop.enable = true;
|
|
|
|
programs.htop.settings = {
|
|
|
|
header_layout = "two_50_50";
|
|
|
|
column_meters_0 = [ "AllCPUs2" "Memory" "Swap" "Zram" ];
|
|
|
|
column_meters_modes_0 = [ modes.Bar modes.Bar modes.Bar modes.Text ];
|
|
|
|
column_meters_1 = [ "Tasks" "LoadAverage" "Uptime" "Systemd" ];
|
|
|
|
column_meters_modes_1 = [ modes.Text modes.Text modes.Text modes.Text ];
|
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.htop = { };
|
|
|
|
|
|
|
|
# Test that the 'fields' key is written in addition to the customized
|
|
|
|
# settings or htop won't read the options.
|
2022-05-13 22:53:16 +02:00
|
|
|
nmt.script = let
|
|
|
|
fields = if pkgs.stdenv.hostPlatform.isDarwin then
|
|
|
|
"0 48 17 18 38 39 2 46 47 49 1"
|
|
|
|
else
|
|
|
|
"0 48 17 18 38 39 40 2 46 47 49 1";
|
|
|
|
in ''
|
2021-11-01 20:27:29 +01:00
|
|
|
htoprc=home-files/.config/htop/htoprc
|
|
|
|
assertFileExists $htoprc
|
|
|
|
assertFileContent $htoprc \
|
|
|
|
${
|
|
|
|
builtins.toFile "htoprc-expected" ''
|
|
|
|
header_layout=two_50_50
|
|
|
|
column_meters_0=AllCPUs2 Memory Swap Zram
|
|
|
|
column_meters_1=Tasks LoadAverage Uptime Systemd
|
|
|
|
column_meters_modes_0=1 1 1 2
|
|
|
|
column_meters_modes_1=2 2 2 2
|
2022-05-13 22:53:16 +02:00
|
|
|
fields=${fields}
|
2021-11-01 20:27:29 +01:00
|
|
|
''
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|