Skip to content

Commit 002a6b1

Browse files
committed
Add an option of using nix-shell instead of nix flake
1 parent a31ef10 commit 002a6b1

4 files changed

Lines changed: 34 additions & 3 deletions

File tree

‎.envrc‎

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# If you want to use this as an .envrc file to create a shell with necessery components
2+
# to develop rustc, use the following command in the root of the rusr checkout:
3+
#
4+
# ln -s ./src/tools/nix-dev-shell/envrc-flake ./.envrc && echo .envrc >> .git/info/exclude
5+
6+
if nix flake show path:./src/tools/nix-dev-shell &> /dev/null; then
7+
use flake path:./src/tools/nix-dev-shell
8+
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# If you want to use this as an .envrc file to create a shell with necessery components
2+
# to develop rustc, use the following command in the root of the rusr checkout:
3+
#
4+
# ln -s ./src/tools/nix-dev-shell/envrc-shell ./.envrc && echo .envrc >> .git/info/exclude
5+
6+
use nix ./src/tools/nix-dev-shell/shell.nix
7+

‎src/tools/nix-dev-shell/shell.nix‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{pkgs ? import<nixpkgs>{}}:
2+
let
3+
x=import./x{inheritpkgs;};
4+
in
5+
pkgs.mkShell{
6+
name="rustc";
7+
nativeBuildInputs=withpkgs;[
8+
binutilscmakeninjapkg-configpython3gitcurlcacertpatchelfnix
9+
];
10+
buildInputs=withpkgs;[
11+
opensslglibc.outglibc.staticx
12+
];
13+
# Avoid creating text files for ICEs.
14+
RUSTC_ICE="0";
15+
# Provide `libstdc++.so.6` for the self-contained lld.
16+
LD_LIBRARY_PATH="${withpkgs;lib.makeLibraryPath[
17+
stdenv.cc.cc.lib
18+
]}";
19+
}

0 commit comments

Comments
 (0)