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
22
tests/modules/programs/nh/darwin/config.nix
Normal file
22
tests/modules/programs/nh/darwin/config.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
|
||||
flake = "/path/to/flake";
|
||||
|
||||
clean = {
|
||||
enable = true;
|
||||
dates = "weekly";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile="LaunchAgents/org.nix-community.home.nh-clean.plist"
|
||||
serviceFileNormalized="$(normalizeStorePaths "$serviceFile")"
|
||||
|
||||
assertFileExists $serviceFile
|
||||
assertFileContent $serviceFileNormalized ${./launchd.plist}
|
||||
|
||||
assertFileRegex home-path/etc/profile.d/hm-session-vars.sh 'NH_FLAKE="/path/to/flake"'
|
||||
'';
|
||||
}
|
||||
25
tests/modules/programs/nh/darwin/launchd.plist
Normal file
25
tests/modules/programs/nh/darwin/launchd.plist
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>org.nix-community.home.nh-clean</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>@nh@/bin/nh</string>
|
||||
<string>clean</string>
|
||||
<string>user</string>
|
||||
</array>
|
||||
<key>StartCalendarInterval</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Hour</key>
|
||||
<integer>0</integer>
|
||||
<key>Minute</key>
|
||||
<integer>0</integer>
|
||||
<key>Weekday</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
{ lib, pkgs, ... }:
|
||||
lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
nh = ./nh.nix;
|
||||
}
|
||||
(lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
|
||||
nh = ./darwin/config.nix;
|
||||
})
|
||||
// (lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux {
|
||||
nh = ./linux/config.nix;
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue