-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
66 lines (63 loc) · 1.88 KB
/
flake.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
foundry = {
url = "github:shazow/foundry.nix"; # Use monthly branch for permanent releases
inputs.nixpkgs.follows = "nixpkgs";
};
solc = {
url = "github:hellwolf/solc.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
rust = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, nixpkgs, flake-utils, foundry, solc, rust }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ foundry.overlay solc.overlay rust.overlays.default ];
};
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
stdenv = if pkgs.stdenv.isLinux then pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv else pkgs.stdenv;
in
{
devShells.default = pkgs.mkShell.override { inherit stdenv; } {
nativeBuildInputs = with pkgs; [
gnum4
];
buildInputs = [
pkgs.rust-analyzer-unwrapped
toolchain
];
packages = with pkgs; [
foundry-bin
gyre-fonts
just
lcov
mdbook
nodejs_20
slither-analyzer
solc_0_8_26
trufflehog
typescript
typst
(solc.mkDefault pkgs solc_0_8_26)
];
shellHook = ''
set -a; source .env; set +a
npm i
forge soldeer install
'';
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.gnum4 ];
TYPST_FONT_PATHS = "${pkgs.gyre-fonts}/share/fonts";
};
});
}