diff options
author | Marc Weber <marco-oweber@gmx.de> | 2009-07-16 15:18:26 +0000 |
---|---|---|
committer | Marc Weber <marco-oweber@gmx.de> | 2009-07-16 15:18:26 +0000 |
commit | 10f6c2592c715c500310a5071b47684c0ab48b29 (patch) | |
tree | 6a3b9fd6dfe59fe03f6a578f4f838fea43e08fb6 /pkgs/build-support/fetchurl/default.nix | |
parent | a20dba3aecd16c55563dff56fe5d594c07ea2718 (diff) | |
download | nixlib-10f6c2592c715c500310a5071b47684c0ab48b29.tar nixlib-10f6c2592c715c500310a5071b47684c0ab48b29.tar.gz nixlib-10f6c2592c715c500310a5071b47684c0ab48b29.tar.bz2 nixlib-10f6c2592c715c500310a5071b47684c0ab48b29.tar.lz nixlib-10f6c2592c715c500310a5071b47684c0ab48b29.tar.xz nixlib-10f6c2592c715c500310a5071b47684c0ab48b29.tar.zst nixlib-10f6c2592c715c500310a5071b47684c0ab48b29.zip |
adding NIX_CONTINUE_DOWNLOADS feature, see mkdir comment
svn path=/nixpkgs/trunk/; revision=16401
Diffstat (limited to 'pkgs/build-support/fetchurl/default.nix')
-rw-r--r-- | pkgs/build-support/fetchurl/default.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix index 00b7f3cc0794..9118b2902268 100644 --- a/pkgs/build-support/fetchurl/default.nix +++ b/pkgs/build-support/fetchurl/default.nix @@ -1,7 +1,7 @@ # Argh, this thing is duplicated (more-or-less) in Nix (in corepkgs). # Need to find a way to combine them. -{stdenv, curl}: # Note that `curl' may be `null', in case of the native stdenv. +{stdenv, curl, getConfig ? (x: y : "")}: # Note that `curl' may be `null', in case of the native stdenv. let @@ -86,6 +86,18 @@ stdenv.mkDerivation { if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5"; outputHash = if outputHash != "" then outputHash else if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5; + + + + # set this to any value to make nix dowload into /var/nix-downloads/$hash + # so that it can continue a half finished download after a shudown, + # susupend to disk, shutdown etc + # for this to work you have to run + # d=/var/nix-downloads; mkdir $d; chgrp nixbld $d; chmod g+x $d; + # once + # defaulting to enabled because continuing takes place only if $d exists + # and has proper permissions + NIX_CONTINUE_DOWNLOADS = getConfig ["NIX_CONTINUE_DOWNLOADS"] "1"; impureEnvVars = [ # We borrow these environment variables from the caller to allow |