-
Notifications
You must be signed in to change notification settings - Fork 1
/
shell.nix
36 lines (30 loc) · 924 Bytes
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs ? import <nixpkgs> {}}:
let
fenix = import (fetchTarball "https://github.com/nix-community/fenix/archive/main.tar.gz") { };
rust-toolchain = with fenix; combine [
(stable.withComponents [
"cargo"
"clippy"
"rust-analyzer"
"rust-src"
"rustc"
])
(latest.withComponents [ "rustfmt" ])
targets.wasm32-unknown-unknown.stable.rust-std
];
mold = pkgs.wrapBintoolsWith { bintools = pkgs.mold; };
in
with pkgs; mkShell {
buildInputs = [
clang
fontconfig
pkg-config
];
# use mold as linker on linux x86_64
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "clang";
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS = "-C link-arg=-fuse-ld=${mold}/bin/ld.mold";
LIBCLANG_PATH = lib.makeLibraryPath [ llvmPackages.libclang ];
RUST_SRC_PATH = "${rust-toolchain}/lib/rustlib/src/rust/library";
EXTRA_CCFLAGS = "-I/usr/include";
RUST_BACKTRACE=1;
}