summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorsils <sils@sils.li>2024-01-13 14:49:11 +0100
committersils <sils@sils.li>2024-01-13 14:49:11 +0100
commitf413aaf003a75cfe647235c0335302a1e908c21b (patch)
treeb8775af62bd53b9a11247ea09aef68171c28fb68
parentfeat(sys/networking): add network (diff)
downloadnix-config-f413aaf003a75cfe647235c0335302a1e908c21b.tar.gz
nix-config-f413aaf003a75cfe647235c0335302a1e908c21b.zip
fix(sys/services/restic): also backup /srv
-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;