Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions nix/modules/devshells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@

# Musl cross-compiler for building remote_server
muslCross = pkgs.pkgsCross.musl64;

# Cargo build timings wrapper script
wrappedCargo = pkgs.writeShellApplication {
name = "cargo";
runtimeInputs = [pkgs.nodejs];
text = ''
NIX_WRAPPER=1 CARGO=${rustToolchain}/bin/cargo ./script/cargo "$@"
'';
};
in
{
devShells.default = (pkgs.mkShell.override { inherit (zed-editor) stdenv; }) {
name = "zed-editor-dev";
inputsFrom = [ zed-editor ];

packages = with pkgs; [
wrappedCargo # must be first, to shadow the `cargo` provided by `rustToolchain`
rustToolchain # cargo, rustc, and rust-toolchain.toml components included
cargo-nextest
cargo-hakari
Expand Down
4 changes: 4 additions & 0 deletions script/cargo
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ async function main() {

// Handle --init flag
if (args[0] === "--init") {
if (process.env.NIX_WRAPPER === "1") {
console.error("`--init` not supported when going through the nix wrapper");
process.exit(1);
}
initShellAlias();
return;
}
Expand Down