Skip to content

Instantly share code, notes, and snippets.

@shajra-cs
Created August 12, 2016 06:31
Show Gist options
  • Save shajra-cs/adc3941cf91c2abdcd22e807b4b67d2d to your computer and use it in GitHub Desktop.
Save shajra-cs/adc3941cf91c2abdcd22e807b4b67d2d to your computer and use it in GitHub Desktop.
code review of a download derivation
source "$stdenv/setup"
curl \
--insecure \
--retry 3 \
--netrc-file "$netrc" \
"$url" > "$out"
{ stdenv
, curl
}:
{ netrc
, url
, name
, sha256
}:
stdenv.mkDerivation {
name = name;
buildInputs = [ curl ];
inherit netrc url;
impureEnvVars = [ "netrc" ];
builder = ./builder.sh;
outputHashAlgo = "sha256";
outputHash = sha256;
outputHashMode = "flat";
preferLocalBuild = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment