1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-02 21:13:33 +02:00
home-manager/tests/modules/programs/htop/settings-without-fields.nix
Bart Bakker e60dca7bb3
htop: fix htoprc when fields is not explicitly set
When the 'fields' setting is not set in htoprc, the htop program won't read any
of the settings. Provide a default value for fields in case it's not explicitly
set by the user.
2021-08-16 23:20:32 +02:00

26 lines
567 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
config = {
programs.htop.enable = true;
programs.htop.settings = { color_scheme = 6; };
# Test that the 'fields' key is written in addition to the customized
# settings or htop won't read the options.
nmt.script = ''
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
''
}
'';
};
}