about summary refs log tree commit diff
path: root/hosts
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-03-13 13:44:57 -0700
committerFranck Cuny <franck@fcuny.net>2022-03-13 13:44:57 -0700
commit3671c8ba2542fa98c6398d666d2e85abafdb9fda (patch)
treec1f431ca198878bdd0d31d8da63f27905121e64c /hosts
parentdefault: install ethtool everywhere (diff)
downloadworld-3671c8ba2542fa98c6398d666d2e85abafdb9fda.tar.gz
rclone: rewrite the service unit
Diffstat (limited to 'hosts')
-rw-r--r--hosts/common/server/rclone.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/hosts/common/server/rclone.nix b/hosts/common/server/rclone.nix
index 808273e..c939e7b 100644
--- a/hosts/common/server/rclone.nix
+++ b/hosts/common/server/rclone.nix
@@ -16,13 +16,14 @@
     };
     services.rclone-sync = {
       description = "synchronize restic repository to GCS";
-      environment.RCLONE_GCS_SERVICE_ACCOUNT_CREDENTIALS =
-        config.age.secrets.rclone-gcs-sa.path;
-      serviceConfig = {
+      serviceConfig = let
+        rcloneOptions =
+          "--config=${config.age.secrets.rclone-config.path} --gcs-service-account-file==${config.age.secrets.rclone-gcs-sa.path} --fast-list --verbose";
+      in {
         Type = "oneshot";
         ExecStart = [
-          "${pkgs.rclone}/bin/rclone --config=${config.age.secrets.rclone-config.path} --fast-list --verbose sync /data/slow/backups gbackup:fcuny-backups-systems"
-          "${pkgs.rclone}/bin/rclone --config=${config.age.secrets.rclone-config.path} --fast-list --verbose sync /data/slow/backups gbackup:fcuny-backups-users"
+          "${pkgs.rclone}/bin/rclone ${rcloneOptions} sync /data/slow/backups gbackup:fcuny-backups-systems"
+          "${pkgs.rclone}/bin/rclone ${rcloneOptions} sync /data/slow/backups gbackup:fcuny-backups-users"
         ];
       };
     };