Use <nix/fetchurl.nix> to download the bootstrap tools
This commit is contained in:
parent
c95cea4bfd
commit
c49404547b
@ -40,19 +40,6 @@ rec {
|
|||||||
# of coreutils, GCC, etc.
|
# of coreutils, GCC, etc.
|
||||||
|
|
||||||
|
|
||||||
# This function downloads a file.
|
|
||||||
download = {url, sha256}: derivation {
|
|
||||||
name = baseNameOf (toString url);
|
|
||||||
builder = bootstrapFiles.sh;
|
|
||||||
inherit system url;
|
|
||||||
inherit (bootstrapFiles) bzip2 mkdir curl cpio ln;
|
|
||||||
args = [ ./scripts/download.sh ];
|
|
||||||
outputHashAlgo = "sha256";
|
|
||||||
outputHash = sha256;
|
|
||||||
impureEnvVars = [ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
|
# Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
|
||||||
bootstrapTools = derivation {
|
bootstrapTools = derivation {
|
||||||
name = "bootstrap-tools";
|
name = "bootstrap-tools";
|
||||||
@ -67,7 +54,7 @@ rec {
|
|||||||
|
|
||||||
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
|
inherit (bootstrapFiles) bzip2 mkdir curl cpio;
|
||||||
|
|
||||||
tarball = download {
|
tarball = import <nix/fetchurl.nix> {
|
||||||
inherit (bootstrapFiles.bootstrapTools) url sha256;
|
inherit (bootstrapFiles.bootstrapTools) url sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
set -e
|
|
||||||
|
|
||||||
$ln -s $curl curl.bz2
|
|
||||||
$bzip2 -d -f curl.bz2
|
|
||||||
./curl --version
|
|
||||||
|
|
||||||
echo "downloading $out from $url"
|
|
||||||
./curl --fail --location --max-redirs 20 "$url" > "$out"
|
|
Loading…
x
Reference in New Issue
Block a user