-
Notifications
You must be signed in to change notification settings - Fork 39
/
shell.nix
74 lines (67 loc) · 1.74 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
72
73
74
{ pkgs, scriptDir }:
with pkgs;
let
postgresql = postgresql_15;
nodejs = nodejs-18_x;
nodePackages = pkgs.nodePackages.override { inherit nodejs; };
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 = [
git
go
goreleaser
postgresql
python3
python3Packages.pip
curl
nodejs
nodePackages.pnpm
nodePackages.yarn
pre-commit
go-ethereum # geth
go-mockery
# tooling
gotools
gopls
delve
github-cli
jq
dasel
typos
# deployment
awscli2
devspace
kubectl
kubernetes-helm
k9s
] ++ lib.optionals stdenv.isLinux [
# some dependencies needed for node-gyp on pnpm install
pkg-config
libudev-zero
libusb1
];
LD_LIBRARY_PATH = lib.makeLibraryPath [pkgs.zlib stdenv.cc.cc.lib]; # lib64
GOROOT = "${go}/share/go";
CGO_ENABLED = "0";
HELM_REPOSITORY_CONFIG = "${scriptDir}/.helm-repositories.yaml";
shellHook = ''
# enable pre-commit hooks
pre-commit install > /dev/null
# enable pre-push hooks
pre-commit install -f --hook-type pre-push > /dev/null
# Update helm repositories
helm repo update > /dev/null
# setup go bin for nix
export GOBIN=$HOME/.nix-go/bin
mkdir -p $GOBIN
export PATH=$GOBIN:$PATH
# install gotestloghelper
go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest
# workaround to install newer golangci-lint, so that we don't have to update all dependencies
go install github.com/golangci/golangci-lint/cmd/[email protected]
'';
}