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:
parent
3375414477
commit
273ad32fbb
3 changed files with 37 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
1
tests/modules/programs/nh/default.nix
Normal file
1
tests/modules/programs/nh/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{ nh = ./nh.nix; }
|
||||||
35
tests/modules/programs/nh/nh.nix
Normal file
35
tests/modules/programs/nh/nh.nix
Normal 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"'
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue