summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--sys/services/restic/default.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/services/restic/default.nix b/sys/services/restic/default.nix
index c4ab7c3..a1bcdf6 100644
--- a/sys/services/restic/default.nix
+++ b/sys/services/restic/default.nix
@@ -4,21 +4,24 @@
   ...
 }: {
   services.restic.backups = let
-    homeDir = "/srv/snapshots/home/sils";
-    srvDir = "${homeDir}/srv";
+    snapshotDir = "/srv/snapshots";
+    homeDir = "${snapshotDir}/home";
     boxUser = "u384702-sub1";
   in {
     storagebox = {
       initialize = true;
       backupPrepareCommand = ''
-        [ -d /srv/snapshots/home ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/home; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /home /srv/snapshots/home;
+        [ -d /srv/snapshots/home ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/home; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /home /srv/snapshots/home; [ -d /srv/snapshots/srv ] && ${pkgs.btrfs-progs}/bin/btrfs subvolume delete /srv/snapshots/srv; ${pkgs.btrfs-progs}/bin/btrfs subvolume snapshot -r /srv /srv/snapshots/srv;
       '';
       paths = [
-        srvDir
-        "${homeDir}/schule"
+        snapshotDir
+      ];
+      exclude = [
+        "${homeDir}/sils/.cache"
+        "${homeDir}/sils/bulk"
+        "${homeDir}/sils/downloads"
       ];
       extraBackupArgs = [
-        "--exclude-if-present .nobackup" # Don't backup directory if it contains a file called ".nobackup"
         "--verbose" # Spam log
       ];
       passwordFile = config.age.secrets.resticpass.path;