mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
htop: verify htoprc contents for example settings test
Fix ending the generated htoprc with a newline.
This commit is contained in:
parent
e4553546cc
commit
447f80f676
3 changed files with 16 additions and 2 deletions
|
@ -146,7 +146,8 @@ in {
|
|||
home.packages = [ pkgs.htop ];
|
||||
|
||||
xdg.configFile."htop/htoprc" = mkIf (cfg.settings != { }) {
|
||||
text = concatStringsSep "\n" (mapAttrsToList formatOption cfg.settings);
|
||||
text = concatStringsSep "\n" (mapAttrsToList formatOption cfg.settings)
|
||||
+ "\n";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
11
tests/modules/programs/htop/example-htoprc.txt
Normal file
11
tests/modules/programs/htop/example-htoprc.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
color_scheme=6
|
||||
cpu_count_from_one=0
|
||||
delay=15
|
||||
fields=0 48 17 18 38 39 40 2 46 47 49 1
|
||||
highlight_base_name=1
|
||||
highlight_megabytes=1
|
||||
highlight_threads=1
|
||||
left_meter_modes=1 1 1 2
|
||||
left_meters=AllCPUs2 Memory Swap Zram
|
||||
right_meter_modes=2 2 2 2
|
||||
right_meters=Tasks LoadAverage Uptime Systemd
|
|
@ -37,7 +37,9 @@ with lib;
|
|||
]);
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/htop/htoprc
|
||||
htoprc=home-files/.config/htop/htoprc
|
||||
assertFileExists $htoprc
|
||||
assertFileContent $htoprc ${./example-htoprc.txt}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue