diff --git a/modules/programs/htop.nix b/modules/programs/htop.nix index a6cf4865a..e6177e228 100644 --- a/modules/programs/htop.nix +++ b/modules/programs/htop.nix @@ -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"; }; }; } diff --git a/tests/modules/programs/htop/example-htoprc.txt b/tests/modules/programs/htop/example-htoprc.txt new file mode 100644 index 000000000..ff06ed5ea --- /dev/null +++ b/tests/modules/programs/htop/example-htoprc.txt @@ -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 diff --git a/tests/modules/programs/htop/example-settings.nix b/tests/modules/programs/htop/example-settings.nix index 66698c844..8705e4b48 100644 --- a/tests/modules/programs/htop/example-settings.nix +++ b/tests/modules/programs/htop/example-settings.nix @@ -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} ''; }; }