1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-18 10:56:53 +00:00
nixpkgs/pkgs/build-support/rust/fetchcargo.nix
Profpatsch 61462c94e6 lib/fetchers.nix: factor out impure proxy vars (#18702)
Apparently everyone just copied those variables, instead of creating a
library constant for them. Some even removed the comment. -.-
2016-09-17 21:50:01 +02:00

26 lines
645 B
Nix

{ stdenv, cacert, git, rust, rustRegistry }:
{ name ? "cargo-deps", src, srcs, sourceRoot, sha256, cargoUpdateHook ? "" }:
stdenv.mkDerivation {
name = "${name}-fetch";
buildInputs = [ rust.cargo rust.rustc git ];
inherit src srcs sourceRoot rustRegistry cargoUpdateHook;
phases = "unpackPhase installPhase";
installPhase = ''
source ${./fetch-cargo-deps}
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
fetchCargoDeps . "$out"
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = sha256;
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
preferLocalBuild = true;
}