mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
Add an option of using nix-shell instead of nix flake
This commit is contained in:
parent
a31ef1059f
commit
002a6b134f
3
.envrc
3
.envrc
@ -1,3 +0,0 @@
|
|||||||
if nix flake show path:./src/tools/nix-dev-shell &> /dev/null; then
|
|
||||||
use flake path:./src/tools/nix-dev-shell
|
|
||||||
fi
|
|
8
src/tools/nix-dev-shell/envrc-flake
Normal file
8
src/tools/nix-dev-shell/envrc-flake
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# If you want to use this as an .envrc file to create a shell with necessery components
|
||||||
|
# to develop rustc, use the following command in the root of the rusr checkout:
|
||||||
|
#
|
||||||
|
# ln -s ./src/tools/nix-dev-shell/envrc-flake ./.envrc && echo .envrc >> .git/info/exclude
|
||||||
|
|
||||||
|
if nix flake show path:./src/tools/nix-dev-shell &> /dev/null; then
|
||||||
|
use flake path:./src/tools/nix-dev-shell
|
||||||
|
fi
|
7
src/tools/nix-dev-shell/envrc-shell
Normal file
7
src/tools/nix-dev-shell/envrc-shell
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# If you want to use this as an .envrc file to create a shell with necessery components
|
||||||
|
# to develop rustc, use the following command in the root of the rusr checkout:
|
||||||
|
#
|
||||||
|
# ln -s ./src/tools/nix-dev-shell/envrc-shell ./.envrc && echo .envrc >> .git/info/exclude
|
||||||
|
|
||||||
|
use nix ./src/tools/nix-dev-shell/shell.nix
|
||||||
|
|
19
src/tools/nix-dev-shell/shell.nix
Normal file
19
src/tools/nix-dev-shell/shell.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
let
|
||||||
|
x = import ./x { inherit pkgs; };
|
||||||
|
in
|
||||||
|
pkgs.mkShell {
|
||||||
|
name = "rustc";
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
binutils cmake ninja pkg-config python3 git curl cacert patchelf nix
|
||||||
|
];
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
openssl glibc.out glibc.static x
|
||||||
|
];
|
||||||
|
# Avoid creating text files for ICEs.
|
||||||
|
RUSTC_ICE = "0";
|
||||||
|
# Provide `libstdc++.so.6` for the self-contained lld.
|
||||||
|
LD_LIBRARY_PATH = "${with pkgs; lib.makeLibraryPath [
|
||||||
|
stdenv.cc.cc.lib
|
||||||
|
]}";
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user