summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--system/linde.nix23
1 files changed, 10 insertions, 13 deletions
diff --git a/system/linde.nix b/system/linde.nix
index b18015bb..29260c21 100644
--- a/system/linde.nix
+++ b/system/linde.nix
@@ -455,31 +455,28 @@ in
   systemd.services.backup-gitolite = {
     startAt = "daily";
     path = with pkgs; [
-      rdiff-backup
       openssh
     ];
-    script = ''
-      rdiff-backup --api-version 201 backup ${config.services.gitolite.dataDir} ${hostname}@nano.${ts-domain}::gitolite
-      rdiff-backup --api-version 201 remove increments --older-than 3M ${hostname}@nano.${ts-domain}::gitolite
-    '';
-    serviceConfig.Type = "oneshot";
+    serviceConfig = {
+      Type = "oneshot";
+      ExecStart = "${lib.getExe pkgs.rdiff-backup} --api-version 201 backup ${config.services.gitolite.dataDir} ${hostname}@nano.${ts-domain}::gitolite";
+      ExecStartPost = "-${lib.getExe pkgs.rdiff-backup} --api-version 201 remove increments --older-than 3M ${hostname}@nano.${ts-domain}::gitolite";
+    };
   };
 
   systemd.services.backup-paperless = {
     startAt = "daily";
     path = with pkgs; [
-      sudo
-      rdiff-backup
       openssh
     ];
-    script = ''
-      systemd-run --machine=papers sudo -u paperless ./paperless-manage document_exporter --delete --use-filename-format --no-archive --no-thumbnail --no-progress-bar ./export
-      rdiff-backup --api-version 201 backup /srv/paperless/export ${hostname}@nano.${ts-domain}::paperless
-      rdiff-backup --api-version 201 remove increments --older-than 3M ${hostname}@nano.${ts-domain}::paperless
-    '';
     serviceConfig = {
       Type = "oneshot";
       WorkingDirectory = config.services.paperless.dataDir;
+      ExecStart = [
+        "systemd-run --machine=papers sudo -u paperless ./paperless-manage document_exporter --delete --use-filename-format --no-archive --no-thumbnail --no-progress-bar ./export  "
+        "${lib.getExe pkgs.rdiff-backup} --api-version 201 backup /srv/paperless/export ${hostname}@nano.${ts-domain}::paperless"
+      ];
+      ExecStartPost = "-${lib.getExe pkgs.rdiff-backup} --api-version 201 remove increments --older-than 3M ${hostname}@nano.${ts-domain}::paperless";
     };
   };