about summary refs log tree commit diff
path: root/hosts
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-04-06 12:42:20 -0700
committerFranck Cuny <franck@fcuny.net>2022-04-06 12:42:20 -0700
commit81fb05398a2c8251936be4bfa0ed679f0cf3825f (patch)
treeb9b0b3945b34bc43d2afa01c2029cf8b5f77eaa1 /hosts
parentrefactor gitea as a module (diff)
downloadworld-81fb05398a2c8251936be4bfa0ed679f0cf3825f.tar.gz
refactor rclone to a module
Diffstat (limited to 'hosts')
-rw-r--r--hosts/common/server/rclone.nix31
-rw-r--r--hosts/profiles/nas.nix3
2 files changed, 1 insertions, 33 deletions
diff --git a/hosts/common/server/rclone.nix b/hosts/common/server/rclone.nix
deleted file mode 100644
index 549cf4d..0000000
--- a/hosts/common/server/rclone.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ config, pkgs, lib, ... }:
-
-{
-  age.secrets.rclone-gcs-sa.file =
-    ../../../secrets/rclone/gcs_service_account.json.age;
-
-  age.secrets.rclone-config.file = ../../../secrets/rclone/config.ini.age;
-
-  systemd = {
-    packages = [ pkgs.rclone ];
-    timers.rclone-sync = {
-      description = "synchronize restic repository to GCS";
-      wantedBy = [ "timers.target" ];
-      partOf = [ "rclone-sync.service" ];
-      timerConfig = { OnCalendar = "02:00"; };
-    };
-    services.rclone-sync = {
-      description = "synchronize restic repository to GCS";
-      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 ${rcloneOptions} sync /data/slow/backups/systems gbackup:fcuny-backups-systems"
-          "${pkgs.rclone}/bin/rclone ${rcloneOptions} sync /data/slow/backups/users gbackup:fcuny-backups-users"
-        ];
-      };
-    };
-  };
-}
diff --git a/hosts/profiles/nas.nix b/hosts/profiles/nas.nix
index 112eda7..fd42eb7 100644
--- a/hosts/profiles/nas.nix
+++ b/hosts/profiles/nas.nix
@@ -4,8 +4,6 @@
     ./server.nix
     ../common/server/traefik.nix
     ../common/server/transmission.nix
-    ../common/server/gitea.nix
-    ../common/server/rclone.nix
   ];
 
   users.groups.nas.gid = 5000;
@@ -31,6 +29,7 @@
       enable = true;
       stateDir = "/var/lib/gitea";
     };
+    rclone = { enable = true; };
   };
 
   services.restic.backups = {