forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
21 lines (17 loc) · 696 Bytes
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
packages = with pkgs; [
# To only build Rust with host system's libLLVM:
curl git unstable.llvmPackages_18.libllvm libxml2 pkg-config python3
# # To also build LLVM from source (comment-out the above):
# cmake gcc gnumake ninja openssl curl git libxml2 pkg-config python3
];
shellHook = ''
# Per ./config.toml
export RUSTFLAGS="-C target-cpu=native"
export RUSTFLAGS_BOOTSTRAP="-C opt-level=3 -C debuginfo=0"
export RUSTFLAGS_NOT_BOOTSTRAP="-Z tune-cpu=native -C inline-threshold=0"
# # Slight chance this might help with running `rust-analyzer` on ./library/**.
# export RUSTC_BOOTSTRAP=1
'';
}