Merge pull request #41343 from jerith666/restic-s3

restic: add s3CredentialsFile option

authored by Matthew Bauer and committed by GitHub dfd90df3 50edf59e

+10
+10
nixos/modules/services/backup/restic.nix
··· 14 Read the repository password from a file. 15 ''; 16 example = "/etc/nixos/restic-password"; 17 18 }; 19 20 repository = mkOption { ··· 134 Type = "oneshot"; 135 ExecStart = "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${concatStringsSep " " backup.paths}"; 136 User = backup.user; 137 }; 138 } // optionalAttrs backup.initialize { 139 preStart = ''
··· 14 Read the repository password from a file. 15 ''; 16 example = "/etc/nixos/restic-password"; 17 + }; 18 19 + s3CredentialsFile = mkOption { 20 + type = with types; nullOr str; 21 + description = '' 22 + file containing the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY 23 + for an S3-hosted repository, in the format of an EnvironmentFile 24 + as described by systemd.exec(5) 25 + ''; 26 }; 27 28 repository = mkOption { ··· 142 Type = "oneshot"; 143 ExecStart = "${resticCmd} backup ${concatStringsSep " " backup.extraBackupArgs} ${concatStringsSep " " backup.paths}"; 144 User = backup.user; 145 + } // optionalAttrs (backup.s3CredentialsFile != null) { 146 + EnvironmentFile = backup.s3CredentialsFile; 147 }; 148 } // optionalAttrs backup.initialize { 149 preStart = ''