about summary refs log tree commit diff
path: root/hosts
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-03-07 07:13:38 -0800
committerFranck Cuny <franck@fcuny.net>2022-03-07 07:13:38 -0800
commit49d4a82a43a12d62858a83a26fd86d27986a9fb8 (patch)
tree4d20bb82e0ce73d2cd3dad05fb72285dd6e25f6e /hosts
parentrestic: add the secret for the repo 'systems' (diff)
downloadworld-49d4a82a43a12d62858a83a26fd86d27986a9fb8.tar.gz
unifi: backup the data to the local reo
Diffstat (limited to '')
-rw-r--r--hosts/common/server/unifi.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/hosts/common/server/unifi.nix b/hosts/common/server/unifi.nix
index ed1f82e..cf38137 100644
--- a/hosts/common/server/unifi.nix
+++ b/hosts/common/server/unifi.nix
@@ -62,5 +62,19 @@ in {
         Type = "oneshot";
       };
     };
+
+    age.secrets.restic-repo-systems.file =
+      ../../../secrets/restic/repo-systems.age;
+
+    services.restic.backups = {
+      unifi = {
+        paths = [ "/var/lib/unifi" ];
+        repository = "/data/slow/backups/systems";
+        passwordFile = config.age.secrets.restic-repo-systems.path;
+        initialize = true;
+        extraBackupArgs = [ "--tag unifi" ];
+        pruneOpts = [ "--keep-daily 7" "--keep-weekly 4" ];
+      };
+    };
   };
 }