nixpkgs/pkgs/build-support/rust/test/import-cargo-lock/git-dependency-rev-non-workspace-nested-crate/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

41 lines
774 B
Nix

{ rustPlatform, pkg-config, openssl, lib, darwin, stdenv }:
let
fs = lib.fileset;
in
rustPlatform.buildRustPackage {
pname = "git-dependency-rev-non-workspace-nested-crate";
version = "0.1.0";
src = fs.toSource {
root = ./.;
fileset = fs.unions [
./Cargo.toml
./Cargo.lock
./src
];
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"cargo-test-macro-0.1.0" = "1yy1y1d523xdzwg1gc77pigbcwsbawmy4b7vw8v21m7q957sk0c4";
};
};
doInstallCheck = true;
installCheckPhase = ''
$out/bin/git-dependency-rev-non-workspace-nested-crate
'';
}