forked from hoprnet/hoprnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
77 lines (65 loc) · 1.72 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
75
76
77
{ pkgs ? import <nixpkgs> { }
, ...
}:
let
linuxPkgs = with pkgs; lib.optional stdenv.isLinux (
inotifyTools
);
macosPkgs = with pkgs; lib.optional stdenv.isDarwin (
with darwin.apple_sdk.frameworks; [
SystemConfiguration
# macOS file watcher support
CoreFoundation
CoreServices
]
);
hoprdPkgs = with pkgs; [
## base
envsubst
## node, minimum recommended version is v18, see README for more details
nodejs-18_x # v18.16.1
(yarn.override { nodejs = nodejs-18_x; }) # v3.6.0 (as per local yarn cfg)
## rust for core development and required utils
(rust-bin.fromRustupToolchainFile ./rust-toolchain.toml)
protobuf # v3.21.12
pkgs.wasm-pack # v0.12.1
pkgs.binaryen # v114 (includes wasm-opt)
wasm-bindgen-cli # v0.2.83
pkg-config
## python is required by node module bcrypto and integration tests
python39 # v3.10.12
];
devPkgs = with pkgs; [
patchelf
curl # v7.88.0
# integration testing utilities
python39Packages.pip
# testing utilities
jq # v1.6
yq-go # v4.30.8
# test Github automation
act # 0.2.42
# test coverage generation
lcov
# custom pkg groups
macosPkgs
linuxPkgs
];
in
with pkgs;
mkShell {
buildInputs = hoprdPkgs ++ devPkgs;
shellHook = ''
echo "Install cargo utils (dependency pruning...)"
cargo install cargo-machete
echo "Installing dependencies"
make deps
echo "Setting up python virtual environment"
python -m venv .venv
source .venv/bin/activate
pip install -r tests/requirements.txt
deactivate
echo "Patching additional binaries"
patchelf --interpreter `cat $NIX_CC/nix-support/dynamic-linker` .venv/bin/ruff
'';
}