mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
services.borgmatic: add initial support for darwin
This commit is contained in:
parent
34d44d7f1b
commit
c09ccd7d39
6 changed files with 81 additions and 0 deletions
|
|
@ -330,6 +330,7 @@ import nmtSrc {
|
|||
./modules/launchd
|
||||
./modules/programs/aerospace
|
||||
./modules/programs/element-desktop/darwin.nix
|
||||
./modules/services/borgmatic-darwin
|
||||
./modules/services/emacs-darwin
|
||||
./modules/services/espanso-darwin
|
||||
./modules/services/git-sync-darwin
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
services.borgmatic = {
|
||||
enable = true;
|
||||
frequency = "weekly";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
serviceFile=LaunchAgents/org.nix-community.home.borgmatic.plist
|
||||
|
||||
assertFileExists "$serviceFile"
|
||||
|
||||
assertFileContent "$serviceFile" ${./expected-agent.plist}
|
||||
'';
|
||||
}
|
||||
4
tests/modules/services/borgmatic-darwin/default.nix
Normal file
4
tests/modules/services/borgmatic-darwin/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
darwin-borgmatic-service-basic-configuration = ./basic-configuration.nix;
|
||||
darwin-borgmatic-frequency-assertion = ./frequency-assertion.nix;
|
||||
}
|
||||
31
tests/modules/services/borgmatic-darwin/expected-agent.plist
Normal file
31
tests/modules/services/borgmatic-darwin/expected-agent.plist
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?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.borgmatic</string>
|
||||
<key>ProcessType</key>
|
||||
<string>Background</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>@borgmatic@/bin/borgmatic</string>
|
||||
<string>--stats</string>
|
||||
<string>--list</string>
|
||||
</array>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/home/hm-user/Library/Logs/borgmatic/launchd-stderr.log</string>
|
||||
<key>StandardOutPath</key>
|
||||
<string>/home/hm-user/Library/Logs/borgmatic/launchd-stdout.log</string>
|
||||
<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>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
services.borgmatic = {
|
||||
enable = true;
|
||||
frequency = "00:02:00";
|
||||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"On Darwin services.borgmatic.frequency must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue