Add a "profile" option to S3BinaryCacheStore

This allows specifying the AWS configuration profile to use. E.g.

  nix copy --from s3://my-cache?profile=aws-dev-account /nix/store/cf3isrlqavvd5w7rpky1fa8j9lcnlggm-...
This commit is contained in:
Eelco Dolstra 2017-11-15 14:16:04 +01:00
parent 897ca33a1c
commit 8956ae1987
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 14 additions and 5 deletions

View file

@ -533,7 +533,7 @@ struct CurlDownloader : public Downloader
// FIXME: do this on a worker thread
sync2async<DownloadResult>(success, failure, [&]() -> DownloadResult {
#ifdef ENABLE_S3
S3Helper s3Helper(Aws::Region::US_EAST_1); // FIXME: make configurable
S3Helper s3Helper("", Aws::Region::US_EAST_1); // FIXME: make configurable
auto slash = request.uri.find('/', 5);
if (slash == std::string::npos)
throw nix::Error("bad S3 URI '%s'", request.uri);