Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ stdenv, runCommand, awscli }: | ||
|
||
{ s3url | ||
, sha256 | ||
, region ? "us-east-1" | ||
, credentials ? null # Default to looking at local EC2 metadata service | ||
, executable ? false | ||
, recursiveHash ? false | ||
, postFetch ? null | ||
}: | ||
|
||
let | ||
credentialAttrs = stdenv.lib.optionalAttrs (credentials != null) { | ||
AWS_ACCESS_KEY_ID = credentials.access_key_id; | ||
AWS_SECRET_ACCESS_KEY = credentials.secret_access_key; | ||
AWS_SESSION_TOKEN = credentials.session_token ? null; | ||
}; | ||
in runCommand "foo" ({ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
copumpkin
via email
Author
Member
|
||
buildInputs = [ awscli ]; | ||
outputHashAlgo = "sha256"; | ||
outputHash = sha256; | ||
outputHashMode = if recursiveHash then "recursive" else "flat"; | ||
} // credentialAttrs) (if postFetch != null then '' | ||
This comment has been minimized.
Sorry, something went wrong.
edolstra
Member
|
||
downloadedFile="$(mktemp)" | ||
aws s3 cp ${s3url} $downloadedFile | ||
${postFetch} | ||
'' else '' | ||
aws s3 cp ${s3url} $out | ||
'') |
@copumpkin I don't suppose we want this to remain
"foo"
😉