From 027996a012b56b7804b5567b24d15fac4d20c795 Mon Sep 17 00:00:00 2001
From: sils <sils@sils.li>
Date: Sat, 6 Jan 2024 20:34:33 +0100
Subject: feat(sys/services): add restic

---
 sys/services/default.nix        |  1 +
 sys/services/restic/default.nix | 24 +++++++++++++++++++++---
 2 files changed, 22 insertions(+), 3 deletions(-)

(limited to 'sys')

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
     };
   };
 }
-- 
cgit 1.4.1