rustPlatform.importCargoLock: passthru lockFile

This is to make it possible to implement support for updating
`Cargo.lock`s in nix-update by exposing the path to the `Cargo.lock`
file
This commit is contained in:
figsoda 2023-02-09 23:50:25 -05:00 committed by Winter
parent 115e3413e1
commit 6fcd1dcb0b

View File

@ -184,10 +184,15 @@ let
''
else throw "Cannot handle crate source: ${pkg.source}";
vendorDir = runCommand "cargo-vendor-dir" (lib.optionalAttrs (lockFile == null) {
inherit lockFileContents;
passAsFile = [ "lockFileContents" ];
}) ''
vendorDir = runCommand "cargo-vendor-dir"
(if lockFile == null then {
inherit lockFileContents;
passAsFile = [ "lockFileContents" ];
} else {
passthru = {
inherit lockFile;
};
}) ''
mkdir -p $out/.cargo
${