htop: fix darwin defaults

M_SHARE is not a valid column on Darwin. It seems that previously htop
ignored unknown columns, but the current version does not display all
subsequent columns.
This commit is contained in:
Roman Timushev 2022-05-13 22:53:16 +02:00 committed by Robert Helgesson
parent cb9f03d519
commit e6869735d2
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 34 additions and 18 deletions

View file

@ -17,7 +17,12 @@ with lib;
# Test that the 'fields' key is written in addition to the customized
# settings or htop won't read the options.
nmt.script = ''
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 ''
htoprc=home-files/.config/htop/htoprc
assertFileExists $htoprc
assertFileContent $htoprc \
@ -28,7 +33,7 @@ with lib;
column_meters_1=Tasks LoadAverage Uptime Systemd
column_meters_modes_0=1 1 1 2
column_meters_modes_1=2 2 2 2
fields=0 48 17 18 38 39 40 2 46 47 49 1
fields=${fields}
''
}
'';

View file

@ -11,14 +11,19 @@ with lib;
# Test that the 'fields' key is written in addition to the customized
# settings or htop won't read the options.
nmt.script = ''
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 ''
htoprc=home-files/.config/htop/htoprc
assertFileExists $htoprc
assertFileContent $htoprc \
${
builtins.toFile "htoprc-expected" ''
color_scheme=6
fields=0 48 17 18 38 39 40 2 46 47 49 1
fields=${fields}
''
}
'';