forked from smartcontractkit/chainlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
71 lines (63 loc) · 1.64 KB
/
shell.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
{pkgs, isCrib}:
with pkgs; let
go = go_1_21;
postgresql = postgresql_14;
nodejs = nodejs-18_x;
nodePackages = pkgs.nodePackages.override {inherit nodejs;};
pnpm = pnpm_9;
mkShell' = mkShell.override {
# The current nix default sdk for macOS fails to compile go projects, so we use a newer one for now.
stdenv =
if stdenv.isDarwin
then overrideSDK stdenv "11.0"
else stdenv;
};
in
mkShell' {
nativeBuildInputs =
[
go
postgresql
python3
python3Packages.pip
protobuf
protoc-gen-go
protoc-gen-go-grpc
foundry-bin
curl
nodejs
pnpm
# TODO: compiler / gcc for secp compilation
go-ethereum # geth
go-mockery
# tooling
gotools
gopls
delve
golangci-lint
github-cli
jq
# gofuzz
]
++ lib.optionals stdenv.isLinux [
# some dependencies needed for node-gyp on pnpm install
pkg-config
libudev-zero
libusb1
] ++ lib.optionals isCrib [
nur.repos.goreleaser.goreleaser-pro
patchelf
];
shellHook = ''
${if !isCrib then "" else ''
if [ -z $GORELEASER_KEY ]; then
echo "GORELEASER_KEY must be set in CRIB environments. You can find it in our 1p vault under 'goreleaser-pro-license'."
exit 1
fi
${if stdenv.isDarwin then "source ./nix-darwin-shell-hook.sh" else ""}
''}
'';
GOROOT = "${go}/share/go";
PGDATA = "db";
CL_DATABASE_URL = "postgresql://chainlink:chainlink@localhost:5432/chainlink_test?sslmode=disable";
}