mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
nix: Coerce rel path to cargo wrapper script into abs path (#50919)
This allows you to now re-use our Zed flake in different side projects with cargo wrapper script having its path correctly resolved. Say you have this dir structure: ``` $HOME/dev/zed $HOME/dev/something ``` Then this now works: ``` $ cd $HOME/dev/something $ nix develop ../zed $ cargo version cargo 1.93.0 (083ac5135 2025-12-15) ``` Release Notes: - N/A
This commit is contained in:
parent
49ef20585d
commit
5289bea46e
1 changed files with 9 additions and 5 deletions
|
|
@ -22,10 +22,14 @@
|
|||
# Cargo build timings wrapper script
|
||||
wrappedCargo = pkgs.writeShellApplication {
|
||||
name = "cargo";
|
||||
runtimeInputs = [pkgs.nodejs];
|
||||
text = ''
|
||||
NIX_WRAPPER=1 CARGO=${rustToolchain}/bin/cargo ./script/cargo "$@"
|
||||
'';
|
||||
runtimeInputs = [ pkgs.nodejs ];
|
||||
text =
|
||||
let
|
||||
pathToCargoScript = ./. + "/../../script/cargo";
|
||||
in
|
||||
''
|
||||
NIX_WRAPPER=1 CARGO=${rustToolchain}/bin/cargo ${pathToCargoScript} "$@"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
@ -34,7 +38,7 @@
|
|||
inputsFrom = [ zed-editor ];
|
||||
|
||||
packages = with pkgs; [
|
||||
wrappedCargo # must be first, to shadow the `cargo` provided by `rustToolchain`
|
||||
wrappedCargo # must be first, to shadow the `cargo` provided by `rustToolchain`
|
||||
rustToolchain # cargo, rustc, and rust-toolchain.toml components included
|
||||
cargo-nextest
|
||||
cargo-hakari
|
||||
|
|
|
|||
Loading…
Reference in a new issue