about summary refs log tree commit diff
path: root/hosts
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-03-08 18:45:37 -0800
committerFranck Cuny <franck@fcuny.net>2022-03-08 18:45:37 -0800
commitf61d21d17df6d476c5353718c89664719e7a7626 (patch)
tree31f0eca9a346932b8c06600777a288dedf6fcf79 /hosts
parentbackups: spread them so they don't clash (diff)
downloadworld-f61d21d17df6d476c5353718c89664719e7a7626.tar.gz
nas: backup photos and music
Instead of rsync-ing these folders to a GCS bucket, I should instead do
a backup. If I screw up something, the content will be sync-ed, and I
won't be able to restore it. It's better (maybe more expensive, but
that's OK) to keep snapshots and be able to restore.
Diffstat (limited to 'hosts')
-rw-r--r--hosts/common/nas.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/hosts/common/nas.nix b/hosts/common/nas.nix
index 2e1b6fc..f9017f2 100644
--- a/hosts/common/nas.nix
+++ b/hosts/common/nas.nix
@@ -17,4 +17,16 @@
     group = "nas";
     isSystemUser = true;
   };
+
+  services.restic.backups = {
+    media = {
+      paths = [ "/data/fast/music" "/data/fast/photos" ];
+      repository = "/data/slow/backups/systems";
+      passwordFile = config.age.secrets.restic-repo-systems.path;
+      timerConfig = { OnCalendar = "00:55"; };
+      initialize = true;
+      extraBackupArgs = [ "--tag media" ];
+      pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" "--keep-monthly 12" ];
+    };
+  };
 }