Skip to content

Commit c206fb4

Browse files
committed
fix: rust-analyzer extension crashin when using nix-env-selector
1 parent 3d3fd01 commit c206fb4

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

shell.nix

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,24 @@
33
}:
44

55
pkgs.mkShell {
6+
67
buildInputs = [
78
pkgs.rustup
89
];
910

11+
TEMPDIR = "/tmp/rust/shell";
12+
TMPDIR = "/tmp/rust/shell";
13+
TEMP = "/tmp/rust/shell";
14+
TMP = "/tmp/rust/shell";
15+
1016
shellHook = ''
11-
DATA_DIR=/tmp/rust
12-
export RUSTUP_HOME=$DATA_DIR/rustup
13-
export CARGO_HOME=$DATA_DIR/cargo
14-
export PATH=$CARGO_HOME/bin:$PATH
15-
mkdir -p $CARGO_HOME
16-
mkdir -p $RUSTUP_HOME
17+
DATA_DIR="/tmp/rust"
18+
export RUSTUP_HOME="$DATA_DIR/rustup"
19+
export CARGO_HOME="$DATA_DIR/cargo"
20+
export PATH=$CARGO_niHOME/bin:$PATH
21+
mkdir -p "$CARGO_HOME"
22+
mkdir -p "$RUSTUP_HOME"
23+
mkdir -p "$DATA_DIR/shell"
1724
1825
rustup default stable
1926
rustup update
@@ -25,6 +32,8 @@ pkgs.mkShell {
2532
2633
echo "Rustup installed at $RUSTUP_HOME"
2734
echo "Cargo installed at $CARGO_HOME"
28-
echo $(cargo --version)
35+
echo "$(rustup --version)"
36+
echo "$(cargo --version)"
2937
'';
38+
3039
}

0 commit comments

Comments
 (0)