From c610f99d8fc25dbdcd8530aca17a838c32ac569f Mon Sep 17 00:00:00 2001 From: tilpner Date: Wed, 14 Jun 2017 23:36:27 +0200 Subject: Expose custom Rust registry versions This allows users to specify a custom registry src, because currently every packager would need to create an outdated Cargo.lock just to be compatible with the probably outdated rustRegistry in nixpkgs. Currently there is no easy way to convince cargo to do that, so this makes that workaround unnecessary. --- pkgs/build-support/rust/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 2275a065594f..6e2c44552252 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -1,4 +1,4 @@ -{ stdenv, cacert, git, rust, rustRegistry }: +{ stdenv, callPackage, path, cacert, git, rust }: { name, depsSha256 , src ? null , srcs ? null @@ -8,9 +8,14 @@ , cargoUpdateHook ? "" , cargoDepsHook ? "" , cargoBuildFlags ? [] +, registry ? null , ... } @ args: let + lib = stdenv.lib; + rustRegistry = callPackage (path + /pkgs/top-level/rust-packages.nix) + (lib.optionalAttrs (registry != null) { src = registry; }); + fetchDeps = import ./fetchcargo.nix { inherit stdenv cacert git rust rustRegistry; }; -- cgit 1.4.1