nixpkgs/pkgs/build-support/rust/test/import-cargo-lock/git-dependency/default.nix
Olivia Crain 1348195416
tests.importCargoLock: fix self-inclusive src listings in .nix files
Replace `src = ./.` instances with more explicit source listings.
Otherwise, derivations will be rebuilt on any change to the files
defining them (e.g. formatting via nixfmt-rfc-style).
2024-04-10 10:27:12 -05:00

31 lines
502 B
Nix

{ lib, rustPlatform }:
let
fs = lib.fileset;
in
rustPlatform.buildRustPackage {
pname = "git-dependency";
version = "0.1.0";
src = fs.toSource {
root = ./.;
fileset = fs.unions [
./Cargo.toml
./Cargo.lock
./src
];
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"rand-0.8.3" = "0ya2hia3cn31qa8894s3av2s8j5bjwb6yq92k0jsnlx7jid0jwqa";
};
};
doInstallCheck = true;
installCheckPhase = ''
$out/bin/git-dependency
'';
}