nixpkgs/pkgs/build-support/rust/test/import-cargo-lock/basic/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

28 lines
379 B
Nix

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