From 3671c8ba2542fa98c6398d666d2e85abafdb9fda Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 13 Mar 2022 13:44:57 -0700 Subject: rclone: rewrite the service unit --- hosts/common/server/rclone.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'hosts') 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" ]; }; }; -- cgit 1.4.1