nix/fetchcargo: restrict src to just Cargo.{toml,lock}
should result in less -vendor pkgs in the nix store
This commit is contained in:
parent
3d844977ef
commit
c420dcad9e
@ -8,7 +8,7 @@ let
|
|||||||
inherit (rust) cargo;
|
inherit (rust) cargo;
|
||||||
};
|
};
|
||||||
adc2tcpDeps = fetchcargo {
|
adc2tcpDeps = fetchcargo {
|
||||||
name = "adc2tcp-deps";
|
name = "adc2tcp";
|
||||||
src = ../.;
|
src = ../.;
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
{ stdenv, cacert, git, cargo, cargo-vendor }:
|
{ stdenv, cacert, git, cargo, cargo-vendor }:
|
||||||
{ name, src, sha256 }:
|
{ name, src, sha256 }:
|
||||||
|
let
|
||||||
|
# `src` restricted to the two files that define dependencies
|
||||||
|
cargoOnlySrc = stdenv.mkDerivation {
|
||||||
|
name = "${name}-cargo";
|
||||||
|
inherit src;
|
||||||
|
phases = "installPhase";
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp ${src}/Cargo.{toml,lock} $out/
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "${name}-vendor";
|
name = "${name}-vendor";
|
||||||
nativeBuildInputs = [ cacert git cargo cargo-vendor ];
|
nativeBuildInputs = [ cacert git cargo cargo-vendor ];
|
||||||
inherit src;
|
src = cargoOnlySrc;
|
||||||
|
|
||||||
phases = "unpackPhase patchPhase installPhase";
|
phases = "unpackPhase patchPhase installPhase";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user