You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f806bf4
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: home-manager/modules/backup-automation.nix
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
{machine, ... }:
1
+
{machine,pkgs,... }:
2
2
3
3
{
4
4
home.file.".local/bin/backup-on-mount"={
@@ -16,9 +16,18 @@
16
16
executable=true;
17
17
};
18
18
19
+
systemd.user.services."backup-failure@"={
20
+
Unit.Description="Notify about backup failure in %i";
21
+
Service={
22
+
Type="oneshot";
23
+
ExecStart="${pkgs.libnotify}/bin/notify-send --urgency=critical --expire-time=0 --app-name=Backups 'Backup service failed' '%i failed. Run backup-health and inspect its journal for details.'";
24
+
};
25
+
};
26
+
19
27
systemd.user.services.backup-on-mount={
20
28
Unit={
21
29
Description="Run Restic backup when the backup drive is mounted";
30
+
OnFailure=["backup-failure@%n.service"];
22
31
After=["graphical-session.target"];
23
32
};
24
33
@@ -46,6 +55,7 @@
46
55
systemd.user.services.restic-maintenance={
47
56
Unit={
48
57
Description="Prune old Restic snapshots and verify repository";
0 commit comments