forked from Snowfork/snowbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
103 lines (86 loc) · 3.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
description = "Snowbridge flake";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
foundry.url = "github:shazow/foundry.nix/monthly";
};
outputs = { self, nixpkgs, flake-utils, foundry }:
let
supportedSystems = [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ];
overlays = [ foundry.overlay ];
in
flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs { inherit system overlays; };
cwd = builtins.toString ./.;
in
with pkgs;
{
devShells.default = pkgs.mkShell {
buildInputs = [
cacert
curl
direnv
git
jq
moreutils
typos
ripgrep
tree
# ps for zombienet, required in pure shells on Linux
ps
# typescript
python311
nodePackages.pnpm
nodejs_20
(yarn.override { nodejs = nodejs_20; })
# ethereum
foundry-bin
go-ethereum
# gnupg for forge install
gnupg
# relayer
go
gotools
gopls
go-outline
gopkgs
godef
golint
mage
revive
delve
# parachain
clang
gcc
libiconv
protobuf
# NOTE: when upgrading rustup, check for a command to install the version in the toolchain file:
# https://github.com/rust-lang/rustup/issues/2686
rustup
cowsay
];
shellHook = ''
# set HOME for direnv:
# direnv needs config, cache & data dirs (DIRENV_CONFIG, XDG_CACHE_HOME & XDG_DATA_HOME
# respectively) that can be automatically set when HOME is available
export HOME=~
export GOCACHE=$PWD/gocache
export GOPATH=$PWD/go
export PATH=$GOPATH/bin:$PATH
export CARGO_HOME=$PWD/.cargo
export RUSTUP_HOME=$PWD/.rustup
export RUST_NIGHTLY_VERSION=nightly-2024-02-08
export PATH=$CARGO_HOME/bin:$PATH
export LODESTAR_VERSION=v1.19.0
eval "$(direnv hook bash)"
# LIBCLANG_PATH points rocksdb to a clang.so on Linux
export LIBCLANG_PATH="$(readlink -f ${pkgs.clang}/resource-root/include | xargs dirname | xargs dirname | xargs dirname)"
cowsay "Development Environment Ready"
'';
};
}
);
nixConfig = {};
}