summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorsils <sils@sils.li>2024-01-06 20:34:33 +0100
committersils <sils@sils.li>2024-01-06 20:34:33 +0100
commit027996a012b56b7804b5567b24d15fac4d20c795 (patch)
treee03155ad8ad66750bf200f0f10dd6285d8628406
parentfeat(secrets): add borgpass (diff)
downloadnix-config-027996a012b56b7804b5567b24d15fac4d20c795.tar.gz
nix-config-027996a012b56b7804b5567b24d15fac4d20c795.zip
feat(sys/services): add restic
-rw-r--r--sys/services/default.nix1
-rw-r--r--sys/services/restic/default.nix24
2 files changed, 22 insertions, 3 deletions
diff --git a/sys/services/default.nix b/sys/services/default.nix
index 8e6fcbb..602931d 100644
--- a/sys/services/default.nix
+++ b/sys/services/default.nix
@@ -6,6 +6,7 @@
     ./openssh
     ./pcscd
     ./printing
+    ./restic
     ./tlp
     ./udev
     ./upower
diff --git a/sys/services/restic/default.nix b/sys/services/restic/default.nix
index 0d02cd4..f79f734 100644
--- a/sys/services/restic/default.nix
+++ b/sys/services/restic/default.nix
@@ -1,6 +1,24 @@
-{...}: {
-  services.restic.backups = {
-    backuphome = {
+{config, ...}: {
+  services.restic.backups = let
+    homeDir = "/home/sils";
+    srvDir = "${homeDir}/srv";
+    boxUser = "u384702-sub1";
+  in {
+    storagebox = {
+      initialize = true;
+      paths = [
+        srvDir
+        "${homeDir}/schule"
+      ];
+      extraBackupArgs = [
+        "--exclude-if-present .nobackup" # Don't backup directory if it contains a file called ".nobackup"
+        "--verbose" # Spam log
+      ];
+      passwordFile = config.age.secrets.borgpass.path;
+      extraOptions = [
+        "rclone.program='ssh -p 23 ${boxUser}@${boxUser}.your-storagebox.de -i ${config.age.secrets.borgssh.path}'"
+      ];
+      repository = "rclone: "; # There is only one repository served
     };
   };
 }