-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
45 lines (39 loc) · 914 Bytes
/
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
{ pkgs ? import ./pkgs.nix {}, ci ? false }:
with pkgs;
mkShell {
nativeBuildInputs = [
nodejs_20
nodejs.python
clang-tools
shellcheck
gitAndTools.gh
];
# Don't set rpath for native addons
NIX_DONT_SET_RPATH = true;
NIX_NO_SELF_RPATH = true;
shellHook = ''
echo "Entering $(npm pkg get name)"
set -o allexport
. ./.env
set +o allexport
set -v
${
lib.optionalString ci
''
set -o errexit
set -o nounset
set -o pipefail
shopt -s inherit_errexit
''
}
mkdir --parents "$(pwd)/tmp"
# Built executables and NPM executables
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
# Path to headers used by node-gyp for native addons
export npm_config_nodedir="${nodejs}"
# Verbose logging of the Nix compiler wrappers
export NIX_DEBUG=1
npm install --ignore-scripts
set +v
'';
}