diff options
author | Franck Cuny <franck@fcuny.net> | 2022-04-10 14:44:33 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-04-10 14:44:33 -0700 |
commit | 6a5cb9b7544168e7136ab2dbd833c9fc63020db7 (patch) | |
tree | 88db9fe9f436648acba60ffea98fd47942343b74 /modules/services/rclone | |
parent | add a module for backup with restic (diff) | |
download | world-6a5cb9b7544168e7136ab2dbd833c9fc63020db7.tar.gz |
secrets: move all the secrets under module/
Refactor a bit the configuration, which should simplify the management and usage of secrets from now on.
Diffstat (limited to 'modules/services/rclone')
-rw-r--r-- | modules/services/rclone/default.nix | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/services/rclone/default.nix b/modules/services/rclone/default.nix index 1ccf5df..1d32aac 100644 --- a/modules/services/rclone/default.nix +++ b/modules/services/rclone/default.nix @@ -1,16 +1,13 @@ { config, pkgs, lib, ... }: -let cfg = config.my.services.rclone; +let + cfg = config.my.services.rclone; + secrets = config.age.secrets; in { options.my.services.rclone = with lib; { enable = mkEnableOption "rclone backup service"; }; config = lib.mkIf cfg.enable { - 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 = { @@ -22,8 +19,11 @@ in { 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"; + rcloneOptions = "--config=${ + secrets."rclone/gcs_service_account.json".path + } --gcs-service-account-file=${ + secrets."rclone/config.ini".path + } --fast-list --verbose"; in { Type = "oneshot"; ExecStart = [ |