forked from M-Labs/thermostat
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;
|
||||
};
|
||||
adc2tcpDeps = fetchcargo {
|
||||
name = "adc2tcp-deps";
|
||||
name = "adc2tcp";
|
||||
src = ../.;
|
||||
inherit sha256;
|
||||
};
|
||||
|
|
|
@ -1,9 +1,21 @@
|
|||
{ stdenv, cacert, git, cargo, cargo-vendor }:
|
||||
{ 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 {
|
||||
name = "${name}-vendor";
|
||||
nativeBuildInputs = [ cacert git cargo cargo-vendor ];
|
||||
inherit src;
|
||||
src = cargoOnlySrc;
|
||||
|
||||
phases = "unpackPhase patchPhase installPhase";
|
||||
|
||||
|
|
Loading…
Reference in New Issue