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
45 lines (40 loc) · 1.27 KB
/
flake.nix
File metadata and controls
45 lines (40 loc) · 1.27 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
{
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.toolchain;
in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
toolchain
# test dependencies
solc
vyper
nodejs
];
buildInputs = lib.optionals pkgs.stdenv.isDarwin
[ pkgs.darwin.apple_sdk.frameworks.AppKit ];
packages = with pkgs; [ rust-analyzer-unwrapped ];
# 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";
};
});
};
}