nixpkgs/pkgs/build-support/rust/test/import-cargo-lock/basic-sparse/default.nix
Ruben Sanchez Diez e6dc0fb1a1 rustPlatform.importCargoLock: Adding sparse protocol
When added the new sparse protocol the derivation is not handling properly Cargo.lock with sparse+ registries
2024-04-17 15:42:49 +02:00

34 lines
585 B
Nix

{ lib, rustPlatform }:
let
fs = lib.fileset;
in
rustPlatform.buildRustPackage {
pname = "basic-sparse";
version = "0.1.0";
src = fs.toSource {
root = ./.;
fileset = fs.unions [
./.cargo/config.toml
./Cargo.toml
./Cargo.lock
./src
];
};
cargoLock = {
lockFile = ./Cargo.lock;
extraRegistries = {
"sparse+https://index.crates.io/" = "https://static.crates.io/crates";
};
};
doInstallCheck = true;
postConfigure = ''
cargo metadata --offline
'';
installCheckPhase = ''
$out/bin/basic-sparse
'';
}