nixpkgs/pkgs/build-support/rust/test/import-cargo-lock/basic-dynamic/default.nix
Robin Stumm d3018c4522 importCargoLock: introduce alternative parameter lockFileContents
In restricted mode (and therefore with flakes) `builtins.readFile` may not be the result of `builtins.toFile`,
making it impossible to use a generated lockFile (with or without IFD),
and thereby causing evaluation to fail if `system != builtins.currentSystem` on Hydra
so the jobs are not delegated to eligible build machines that support that system.

This is done in a way that avoids rebuilds.
2021-09-20 14:54:40 +02:00

17 lines
264 B
Nix

{ rustPlatform }:
rustPlatform.buildRustPackage {
pname = "basic-dynamic";
version = "0.1.0";
src = ./.;
cargoLock.lockFileContents = builtins.readFile ./Cargo.lock;
doInstallCheck = true;
installCheckPhase = ''
$out/bin/basic-dynamic
'';
}