forked from gakonst/ethers-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
66 lines (61 loc) · 1.56 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 = {
devenv.url = "github:cachix/devenv";
flake-utils.url = "github:numtide/flake-utils";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
foundry = {
url = "github:shazow/foundry.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, nixpkgs
, flake-utils
, fenix
, foundry
, devenv
} @ inputs:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs {
inherit system;
};
in
{
devShell = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
{
packages = with pkgs; [
solc
gcc
foundry.defaultPackage.${system}
go-ethereum
] lib.optionals stdenv.isDarwin (with darwin.apple_sdk; [
libiconv
frameworks.Security
]);
# https://devenv.sh/languages/
languages.nix.enable = true;
languages.rust = {
enable = true;
version = "stable";
packages = {
rustfmt = inputs.fenix.packages.${pkgs.system}.latest.rustfmt;
clippy = inputs.fenix.packages.${pkgs.system}.latest.clippy;
};
};
# https://devenv.sh/pre-commit-hooks/
pre-commit.hooks = {
shellcheck.enable = true;
clippy.enable = true;
rustfmt.enable = true;
};
}
];
};
});
}