diff --git a/tests/default.nix b/tests/default.nix index 0e90c6338..934373e89 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -533,6 +533,7 @@ import nmtSrc { ./modules/programs/looking-glass-client ./modules/programs/mangohud ./modules/programs/ncmpcpp-linux + ./modules/programs/nh ./modules/programs/pqiv ./modules/programs/rbw ./modules/programs/rofi diff --git a/tests/modules/programs/nh/default.nix b/tests/modules/programs/nh/default.nix new file mode 100644 index 000000000..77607ab99 --- /dev/null +++ b/tests/modules/programs/nh/default.nix @@ -0,0 +1 @@ +{ nh = ./nh.nix; } diff --git a/tests/modules/programs/nh/nh.nix b/tests/modules/programs/nh/nh.nix new file mode 100644 index 000000000..5cdf78d92 --- /dev/null +++ b/tests/modules/programs/nh/nh.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: +{ + programs.nh = { + enable = true; + package = config.lib.test.mkStubPackage { version = "4.0.0"; }; + + flake = "/path/to/flake"; + + clean = { + enable = true; + dates = "daily"; + }; + }; + + nmt.script = '' + unitDir=home-files/.config/systemd/user + timerFile=$unitDir/nh-clean.timer + + assertFileExists $timerFile + assertFileContent $timerFile ${pkgs.writeText "timer-expected" '' + [Install] + WantedBy=timers.target + + [Timer] + OnCalendar=daily + Persistent=true + + [Unit] + Description=Run nh clean + ''} + assertFileExists $unitDir/timers.target.wants/nh-clean.timer + + assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_FLAKE="/path/to/flake"' + ''; +}