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.
This commit is contained in:
tilpner
2017-06-25 11:56:15 +01:00
committed by Jörg Thalheim
parent 46427b77f4
commit c610f99d8f
3 changed files with 15 additions and 21 deletions
+6 -1
View File
@@ -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;
};