mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
fetchs3: support hash
attribute
This commit is contained in:
parent
b5aefcd40a
commit
1ccd5ba540
@ -1,8 +1,9 @@
|
||||
{ lib, runCommand, awscli }:
|
||||
|
||||
lib.fetchers.withNormalizedHash { } (
|
||||
{ s3url
|
||||
, name ? builtins.baseNameOf s3url
|
||||
, sha256
|
||||
, outputHash
|
||||
, outputHashAlgo
|
||||
, region ? "us-east-1"
|
||||
, credentials ? null # Default to looking at local EC2 metadata service
|
||||
, recursiveHash ? false
|
||||
@ -20,8 +21,7 @@ let
|
||||
in runCommand name ({
|
||||
nativeBuildInputs = [ awscli ];
|
||||
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = sha256;
|
||||
inherit outputHash outputHashAlgo;
|
||||
outputHashMode = if recursiveHash then "recursive" else "flat";
|
||||
|
||||
preferLocalBuild = true;
|
||||
@ -34,3 +34,4 @@ in runCommand name ({
|
||||
'' else ''
|
||||
aws s3 cp ${s3url} $out
|
||||
'')
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user