mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
restic: add s3CredentialsFile option
This commit is contained in:
parent
5da85431fb
commit
c61aad6574
@ -14,7 +14,15 @@ with lib;
|
|||||||
Read the repository password from a file.
|
Read the repository password from a file.
|
||||||
'';
|
'';
|
||||||
example = "/etc/nixos/restic-password";
|
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 {
|
repository = mkOption {
|
||||||
@ -134,6 +142,8 @@ with lib;
|
|||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${concatStringsSep " " backup.paths}";
|
ExecStart = "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${concatStringsSep " " backup.paths}";
|
||||||
User = backup.user;
|
User = backup.user;
|
||||||
|
} // optionalAttrs (backup.s3CredentialsFile != null) {
|
||||||
|
EnvironmentFile = backup.s3CredentialsFile;
|
||||||
};
|
};
|
||||||
} // optionalAttrs backup.initialize {
|
} // optionalAttrs backup.initialize {
|
||||||
preStart = ''
|
preStart = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user