nh: fix clean option behaviour for Darwin
This commit is contained in:
parent
78fc50f1cf
commit
e8a3e2c1e0
6 changed files with 77 additions and 5 deletions
35
tests/modules/programs/nh/linux/config.nix
Normal file
35
tests/modules/programs/nh/linux/config.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