-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
84 lines (81 loc) · 2.17 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
description = "A super boring flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
foundry = {
url = "github:shazow/foundry.nix/monthly";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
solc = {
url = "github:hellwolf/solc.nix";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
mk-cache-key = {
url = "github:hellwolf/mk-cache-key.nix";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
flake-utils,
nixpkgs,
foundry,
solc,
mk-cache-key,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
solcVer = "solc_0_8_26";
pkgs = import nixpkgs {
inherit system;
overlays = [
foundry.overlay
solc.overlay
];
};
solhint = with pkgs; buildNpmPackage rec {
pname = "solhint";
version = "5.0.3";
src = fetchFromGitHub {
owner = "protofire";
repo = "solhint";
rev = "v${version}";
hash = "sha256-uiVGbV66LzewMLBThNdtcjnBlCUFxTY94yDRFv7jdvw=";
};
npmDepsHash = "sha256-dNweOrXTS5lmnj7odCZsChysSYrWYRIPHk4KO1HVTG4=";
dontNpmBuild = true;
};
mk-cache-key-pkg = mk-cache-key.packages.${system}.default;
in
{
# ci & local development shells
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
mk-cache-key-pkg
jq
yq
solhint
actionlint
lcov
bun
foundry-bin
pkgs.${solcVer}
(solc.mkDefault pkgs pkgs.${solcVer})
];
shellHook = ''
export FOUNDRY_OFFLINE=true;
export FOUNDRY_SOLC_VERSION=${pkgs.lib.getExe pkgs.${solcVer}};
'';
};
devShells.mk-cache-key = pkgs.mkShell {
buildInputs = [ mk-cache-key-pkg ];
};
}
);
}