diff options
author | figsoda <figsoda@pm.me> | 2023-02-09 23:50:25 -0500 |
---|---|---|
committer | Winter <winter@winter.cafe> | 2023-02-26 00:46:36 -0500 |
commit | 6fcd1dcb0bdd12676fae025f5f2a5f56cf363968 (patch) | |
tree | d687e6b1fe216614cedd963926907a72e7699de5 /pkgs/build-support/rust | |
parent | 115e3413e1ffb822d490ed11fa0d36d5f01cc268 (diff) |
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
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r-- | pkgs/build-support/rust/import-cargo-lock.nix | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/build-support/rust/import-cargo-lock.nix b/pkgs/build-support/rust/import-cargo-lock.nix index 4ce552debe821..9ff9c2f6289c1 100644 --- a/pkgs/build-support/rust/import-cargo-lock.nix +++ b/pkgs/build-support/rust/import-cargo-lock.nix @@ -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 ${ |