forked from andresilva/polkadot.nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
35 lines (32 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
{ pkgs }:
let
rust-toolchain =
with pkgs.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.override { stdenv = clangStdenv; } {
packages = [
openssl
pkg-config
rust-toolchain
];
# 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 ];
PROTOC = "${lib.makeBinPath [ protobuf ]}/protoc";
ROCKSDB_LIB_DIR = lib.makeLibraryPath [ rocksdb ];
RUST_SRC_PATH = "${rust-toolchain}/lib/rustlib/src/rust/library";
}