From 0a2bee307b20411f5b0dda0c662b1f9bb9e0e131 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 20 Jul 2015 04:30:16 +0200 Subject: Make a builtin builder This ensures that 1) the derivation doesn't change when Nix changes; 2) the derivation closure doesn't contain Nix and its dependencies; 3) we don't have to rely on ugly chroot hacks. --- corepkgs/config.nix.in | 1 - corepkgs/fetchurl.nix | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'corepkgs') diff --git a/corepkgs/config.nix.in b/corepkgs/config.nix.in index 8918f4ddde..90e8edbea8 100644 --- a/corepkgs/config.nix.in +++ b/corepkgs/config.nix.in @@ -12,7 +12,6 @@ in rec { tar = "@tar@"; tarFlags = "@tarFlags@"; tr = "@tr@"; - curl = "@curl@"; nixBinDir = fromEnv "NIX_BIN_DIR" "@bindir@"; nixPrefix = "@prefix@"; diff --git a/corepkgs/fetchurl.nix b/corepkgs/fetchurl.nix index 1ce88593cf..64d1f121f8 100644 --- a/corepkgs/fetchurl.nix +++ b/corepkgs/fetchurl.nix @@ -5,20 +5,9 @@ with import ; assert (outputHash != "" && outputHashAlgo != "") || md5 != "" || sha1 != "" || sha256 != ""; -let - - builder = builtins.toFile "fetchurl.sh" - ('' - echo "downloading $url into $out" - ${curl} --fail --location --max-redirs 20 --insecure "$url" > "$out" - '' + (if executable then "${coreutils}/chmod +x $out" else "")); - -in - derivation { name = baseNameOf (toString url); - builder = shell; - args = [ "-e" builder ]; + builder = "builtin:fetchurl"; # New-style output content requirements. outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else @@ -39,6 +28,4 @@ derivation { # by definition pure. "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ]; - - inherit chrootDeps; } -- cgit 1.4.1