nixpkgs/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-branch/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
516 B
Nix

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