1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

tests/nh: init tests (#6819)

This commit is contained in:
Austin Horstman 2025-04-14 10:07:02 -07:00 committed by GitHub
parent 3375414477
commit 273ad32fbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 0 deletions

View file

@ -533,6 +533,7 @@ import nmtSrc {
./modules/programs/looking-glass-client ./modules/programs/looking-glass-client
./modules/programs/mangohud ./modules/programs/mangohud
./modules/programs/ncmpcpp-linux ./modules/programs/ncmpcpp-linux
./modules/programs/nh
./modules/programs/pqiv ./modules/programs/pqiv
./modules/programs/rbw ./modules/programs/rbw
./modules/programs/rofi ./modules/programs/rofi

View file

@ -0,0 +1 @@
{ nh = ./nh.nix; }

View file

@ -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"'
'';
}