summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-06-28 20:43:41 -0400
committerGitHub <noreply@github.com>2018-06-28 20:43:41 -0400
commitdfd90df391913118b01b00028e422fa1cba1a531 (patch)
tree6b8b5c372aeeb1cf02827a925685c51e81350c98 /nixos/modules/services
parent50edf59e1b7e0ab3fccd99d0bc1452cc1f7a7ae5 (diff)
parentc61aad65744cbeca78504b64f4b346870e3bf2f7 (diff)
downloadnixlib-dfd90df391913118b01b00028e422fa1cba1a531.tar
nixlib-dfd90df391913118b01b00028e422fa1cba1a531.tar.gz
nixlib-dfd90df391913118b01b00028e422fa1cba1a531.tar.bz2
nixlib-dfd90df391913118b01b00028e422fa1cba1a531.tar.lz
nixlib-dfd90df391913118b01b00028e422fa1cba1a531.tar.xz
nixlib-dfd90df391913118b01b00028e422fa1cba1a531.tar.zst
nixlib-dfd90df391913118b01b00028e422fa1cba1a531.zip
Merge pull request #41343 from jerith666/restic-s3
restic: add s3CredentialsFile option
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/backup/restic.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix
index 21d82469c605..2d14762e8685 100644
--- a/nixos/modules/services/backup/restic.nix
+++ b/nixos/modules/services/backup/restic.nix
@@ -14,7 +14,15 @@ with lib;
             Read the repository password from a file.
           '';
           example = "/etc/nixos/restic-password";
+        };
 
+        s3CredentialsFile = mkOption {
+          type = with types; nullOr str;
+          description = ''
+            file containing the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
+            for an S3-hosted repository, in the format of an EnvironmentFile
+            as described by systemd.exec(5)
+          '';
         };
 
         repository = mkOption {
@@ -134,6 +142,8 @@ with lib;
             Type = "oneshot";
             ExecStart = "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${concatStringsSep " " backup.paths}";
             User = backup.user;
+          } // optionalAttrs (backup.s3CredentialsFile != null) {
+            EnvironmentFile = backup.s3CredentialsFile;
           };
         } // optionalAttrs backup.initialize {
           preStart = ''