Skip to content

Commit 002a6b1

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

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

.envrc

-3
This file was deleted.

src/tools/nix-dev-shell/envrc-flake

+8
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

src/tools/nix-dev-shell/envrc-shell

+7
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

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{ pkgs ? import <nixpkgs> {} }:
2+
let
3+
x = import ./x { inherit pkgs; };
4+
in
5+
pkgs.mkShell {
6+
name = "rustc";
7+
nativeBuildInputs = with pkgs; [
8+
binutils cmake ninja pkg-config python3 git curl cacert patchelf nix
9+
];
10+
buildInputs = with pkgs; [
11+
openssl glibc.out glibc.static x
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 = "${with pkgs; lib.makeLibraryPath [
17+
stdenv.cc.cc.lib
18+
]}";
19+
}

0 commit comments

Comments
 (0)