forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
60 lines (54 loc) · 1.69 KB
/
flake.nix
File metadata and controls
60 lines (54 loc) · 1.69 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, fenix }:
let eachSystem = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
in {
devShells = eachSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ fenix.overlays.default ];
};
lib = pkgs.lib;
toolchain = fenix.packages.${system}.stable.withComponents [
"rustc"
"cargo"
"rust-std"
"clippy-preview"
"rust-analyzer-preview"
"rust-src"
];
nightlyToolchain = fenix.packages.${system}.latest.withComponents [
"rustfmt-preview"
];
in
{
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
toolchain
nightlyToolchain
# test dependencies
solc
vyper
dprint
nodejs
];
packages = with pkgs; [ rust-analyzer-unwrapped ];
# Remove the hardening added by nix to fix jmalloc compilation error.
# More info: https://github.com/tikv/jemallocator/issues/108
hardeningDisable = [ "fortify" ];
# Environment variables
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.libusb1 ];
CFLAGS = "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE";
};
});
};
}