···3# tag="<tagname>" (get version by tag name)
4# If you don't specify neither one date="NOW" will be used (get latest)
56-{stdenv, cvs}:
78{cvsRoot, module, tag ? null, date ? null, sha256}:
910-stdenv.mkDerivation {
11 name = "cvs-export";
12 builder = ./builder.sh;
13- buildInputs = [cvs];
1415 outputHashAlgo = "sha256";
16 outputHashMode = "recursive";
···3# tag="<tagname>" (get version by tag name)
4# If you don't specify neither one date="NOW" will be used (get latest)
56+{stdenvNoCC, cvs}:
78{cvsRoot, module, tag ? null, date ? null, sha256}:
910+stdenvNoCC.mkDerivation {
11 name = "cvs-export";
12 builder = ./builder.sh;
13+ nativeBuildInputs = [cvs];
1415 outputHashAlgo = "sha256";
16 outputHashMode = "recursive";
+3-3
pkgs/build-support/fetchdarcs/default.nix
···1-{stdenv, darcs, nix, cacert}:
23{url, rev ? null, context ? null, md5 ? "", sha256 ? ""}:
45if md5 != "" then
6 throw "fetchdarcs does not support md5 anymore, please use sha256"
7else
8-stdenv.mkDerivation {
9 name = "fetchdarcs";
10 NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
11 builder = ./builder.sh;
12- buildInputs = [darcs];
1314 outputHashAlgo = "sha256";
15 outputHashMode = "recursive";
···1+{stdenvNoCC, darcs, nix, cacert}:
23{url, rev ? null, context ? null, md5 ? "", sha256 ? ""}:
45if md5 != "" then
6 throw "fetchdarcs does not support md5 anymore, please use sha256"
7else
8+stdenvNoCC.mkDerivation {
9 name = "fetchdarcs";
10 NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
11 builder = ./builder.sh;
12+ nativeBuildInputs = [darcs];
1314 outputHashAlgo = "sha256";
15 outputHashMode = "recursive";
+4-4
pkgs/build-support/fetchegg/default.nix
···1# Fetches a chicken egg from henrietta using `chicken-install -r'
2# See: http://wiki.call-cc.org/chicken-projects/egg-index-4.html
34-{ stdenv, chicken }:
5{ name, version, md5 ? "", sha256 ? "" }:
67if md5 != "" then
8 throw "fetchegg does not support md5 anymore, please use sha256"
9else
10-stdenv.mkDerivation {
11 name = "chicken-${name}-export";
12 builder = ./builder.sh;
13- buildInputs = [ chicken ];
1415 outputHashAlgo = "sha256";
16 outputHashMode = "recursive";
···2021 eggName = name;
2223- impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
24}
25
···1# Fetches a chicken egg from henrietta using `chicken-install -r'
2# See: http://wiki.call-cc.org/chicken-projects/egg-index-4.html
34+{ stdenvNoCC, chicken }:
5{ name, version, md5 ? "", sha256 ? "" }:
67if md5 != "" then
8 throw "fetchegg does not support md5 anymore, please use sha256"
9else
10+stdenvNoCC.mkDerivation {
11 name = "chicken-${name}-export";
12 builder = ./builder.sh;
13+ nativeBuildInputs = [ chicken ];
1415 outputHashAlgo = "sha256";
16 outputHashMode = "recursive";
···2021 eggName = name;
2223+ impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
24}
25
+1-1
pkgs/build-support/fetchfossil/default.nix
···5stdenv.mkDerivation {
6 name = "fossil-archive" + (if name != null then "-${name}" else "");
7 builder = ./builder.sh;
8- buildInputs = [fossil];
910 # Envvar docs are hard to find. A link for the future:
11 # https://www.fossil-scm.org/index.html/doc/trunk/www/env-opts.md
···5stdenv.mkDerivation {
6 name = "fossil-archive" + (if name != null then "-${name}" else "");
7 builder = ./builder.sh;
8+ nativeBuildInputs = [fossil];
910 # Envvar docs are hard to find. A link for the future:
11 # https://www.fossil-scm.org/index.html/doc/trunk/www/env-opts.md
+5-5
pkgs/build-support/fetchgit/default.nix
···1-{stdenv, git, cacert}: let
2 urlToName = url: rev: let
3- inherit (stdenv.lib) removeSuffix splitString last;
4 base = last (splitString ":" (baseNameOf (removeSuffix "/" url)));
56 matched = builtins.match "(.*).git" base;
···48if md5 != "" then
49 throw "fetchgit does not support md5 anymore, please use sha256"
50else
51-stdenv.mkDerivation {
52 inherit name;
53 builder = ./builder.sh;
54 fetcher = "${./nix-prefetch-git}"; # This must be a string to ensure it's called with bash.
55- buildInputs = [git];
5657 outputHashAlgo = "sha256";
58 outputHashMode = "recursive";
···6263 GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
6465- impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars ++ [
66 "GIT_PROXY_COMMAND" "SOCKS_SERVER"
67 ];
68
···1+{stdenvNoCC, git, cacert}: let
2 urlToName = url: rev: let
3+ inherit (stdenvNoCC.lib) removeSuffix splitString last;
4 base = last (splitString ":" (baseNameOf (removeSuffix "/" url)));
56 matched = builtins.match "(.*).git" base;
···48if md5 != "" then
49 throw "fetchgit does not support md5 anymore, please use sha256"
50else
51+stdenvNoCC.mkDerivation {
52 inherit name;
53 builder = ./builder.sh;
54 fetcher = "${./nix-prefetch-git}"; # This must be a string to ensure it's called with bash.
55+ nativeBuildInputs = [git];
5657 outputHashAlgo = "sha256";
58 outputHashMode = "recursive";
···6263 GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
6465+ impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars ++ [
66 "GIT_PROXY_COMMAND" "SOCKS_SERVER"
67 ];
68
···1-{stdenv, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}:
23if md5 != null then
4 throw "fetchhg does not support md5 anymore, please use sha256"
5else
6# TODO: statically check if mercurial as the https support if the url starts woth https.
7-stdenv.mkDerivation {
8 name = "hg-archive" + (if name != null then "-${name}" else "");
9 builder = ./builder.sh;
10- buildInputs = [mercurial];
1112- impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
1314 subrepoClause = if fetchSubrepos then "S" else "";
15
···1+{stdenvNoCC, mercurial, nix}: {name ? null, url, rev ? null, md5 ? null, sha256 ? null, fetchSubrepos ? false}:
23if md5 != null then
4 throw "fetchhg does not support md5 anymore, please use sha256"
5else
6# TODO: statically check if mercurial as the https support if the url starts woth https.
7+stdenvNoCC.mkDerivation {
8 name = "hg-archive" + (if name != null then "-${name}" else "");
9 builder = ./builder.sh;
10+ nativeBuildInputs = [mercurial];
1112+ impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
1314 subrepoClause = if fetchSubrepos then "S" else "";
15
+1-1
pkgs/build-support/fetchipfs/default.nix
···28if (!hasHash) then throw "Specify sha for fetchipfs fixed-output derivation" else stdenv.mkDerivation {
29 name = ipfs;
30 builder = ./builder.sh;
31- buildInputs = [ curl ];
3233 # New-style output content requirements.
34 outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
···28if (!hasHash) then throw "Specify sha for fetchipfs fixed-output derivation" else stdenv.mkDerivation {
29 name = ipfs;
30 builder = ./builder.sh;
31+ nativeBuildInputs = [ curl ];
3233 # New-style output content requirements.
34 outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
+3-3
pkgs/build-support/fetchmtn/default.nix
···1# You can specify some extra mirrors and a cache DB via options
2-{stdenv, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}:
3# dbs is a list of strings
4# each is an url for sync
5···8{name ? "mtn-checkout", dbs ? [], sha256
9, selector ? "h:" + branch, branch}:
1011-stdenv.mkDerivation {
12 builder = ./builder.sh;
13 nativeBuildInputs = [monotone];
14···19 dbs = defaultDBMirrors ++ dbs;
20 inherit branch cacheDB name selector;
2122- impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
2324}
25
···1# You can specify some extra mirrors and a cache DB via options
2+{stdenvNoCC, monotone, defaultDBMirrors ? [], cacheDB ? "./mtn-checkout.db"}:
3# dbs is a list of strings
4# each is an url for sync
5···8{name ? "mtn-checkout", dbs ? [], sha256
9, selector ? "h:" + branch, branch}:
1011+stdenvNoCC.mkDerivation {
12 builder = ./builder.sh;
13 nativeBuildInputs = [monotone];
14···19 dbs = defaultDBMirrors ++ dbs;
20 inherit branch cacheDB name selector;
2122+ impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars;
2324}
25
···1-{ stdenv, curl }: # Note that `curl' may be `null', in case of the native stdenv.
23let
4···10 # resulting store derivations (.drv files) much smaller, which in
11 # turn makes nix-env/nix-instantiate faster.
12 mirrorsFile =
13- stdenv.mkDerivation ({
14 name = "mirrors-list";
15 builder = ./write-mirror-list.sh;
16 preferLocalBuild = true;
···20 # "gnu", etc.).
21 sites = builtins.attrNames mirrors;
2223- impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars ++ [
24 # This variable allows the user to pass additional options to curl
25 "NIX_CURL_FLAGS"
26···103in
104105if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512"
106-else if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${stdenv.lib.concatStringsSep ", " urls_}"
107-else stdenv.mkDerivation {
108 name =
109 if showURLs then "urls"
110 else if name != "" then name
···112113 builder = ./builder.sh;
114115- buildInputs = [ curl ];
116117 urls = urls_;
118
···1+{ stdenvNoCC, curl }: # Note that `curl' may be `null', in case of the native stdenvNoCC.
23let
4···10 # resulting store derivations (.drv files) much smaller, which in
11 # turn makes nix-env/nix-instantiate faster.
12 mirrorsFile =
13+ stdenvNoCC.mkDerivation ({
14 name = "mirrors-list";
15 builder = ./write-mirror-list.sh;
16 preferLocalBuild = true;
···20 # "gnu", etc.).
21 sites = builtins.attrNames mirrors;
2223+ impureEnvVars = stdenvNoCC.lib.fetchers.proxyImpureEnvVars ++ [
24 # This variable allows the user to pass additional options to curl
25 "NIX_CURL_FLAGS"
26···103in
104105if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512"
106+else if (!hasHash) then throw "Specify hash for fetchurl fixed-output derivation: ${stdenvNoCC.lib.concatStringsSep ", " urls_}"
107+else stdenvNoCC.mkDerivation {
108 name =
109 if showURLs then "urls"
110 else if name != "" then name
···112113 builder = ./builder.sh;
114115+ nativeBuildInputs = [ curl ];
116117 urls = urls_;
118
···118 initialPath = [ bootstrapTools ];
119120 fetchurlBoot = import ../../build-support/fetchurl {
121- stdenv = stage0.stdenv;
122- curl = bootstrapTools;
123 };
124125 # The stdenvs themselves don't use mkDerivation, so I need to specify this here
···118 initialPath = [ bootstrapTools ];
119120 fetchurlBoot = import ../../build-support/fetchurl {
121+ stdenvNoCC = stage0.stdenv;
122+ curl = bootstrapTools;
123 };
124125 # The stdenvs themselves don't use mkDerivation, so I need to specify this here
+2-2
pkgs/top-level/all-packages.nix
···180181 # `fetchurl' downloads a file from the network.
182 fetchurl = import ../build-support/fetchurl {
183- inherit stdenv;
184 # On darwin, libkrb5 needs bootstrap_cmds which would require
185 # converting many packages to fetchurl_boot to avoid evaluation cycles.
186- curl = curl.override (lib.optionalAttrs stdenv.isDarwin { gssSupport = false; });
187 };
188189 fetchRepoProject = callPackage ../build-support/fetchrepoproject { };
···180181 # `fetchurl' downloads a file from the network.
182 fetchurl = import ../build-support/fetchurl {
183+ inherit stdenvNoCC;
184 # On darwin, libkrb5 needs bootstrap_cmds which would require
185 # converting many packages to fetchurl_boot to avoid evaluation cycles.
186+ curl = buildPackages.curl.override (lib.optionalAttrs stdenv.isDarwin { gssSupport = false; });
187 };
188189 fetchRepoProject = callPackage ../build-support/fetchrepoproject { };