-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathshell.nix
More file actions
46 lines (42 loc) · 1.05 KB
/
shell.nix
File metadata and controls
46 lines (42 loc) · 1.05 KB
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
{ pkgs ? import ./nix/nixpkgs.nix }:
let
pythonBase = pkgs.python311;
python = pythonBase.withPackages (ps: [
ps.grpcio-tools
ps.jinja2
ps.protobuf
ps.pytest
ps.pyyaml
]);
in
pkgs.mkShell {
packages = [
pkgs.gh
pkgs.jdk17_headless
pkgs.nodejs_22
python
];
shellHook = ''
export JAVA_HOME="${pkgs.jdk17_headless}"
export PATH="$PWD/node_modules/.bin:$JAVA_HOME/bin:${pkgs.nodejs_22}/bin:${python}/bin:${pkgs.gh}/bin:$HOME/.dpm/bin:$HOME/.daml/bin:$PATH"
export PYTHONPATH="$PWD/src''${PYTHONPATH:+:$PYTHONPATH}"
case " $NODE_OPTIONS " in
*" --max-old-space-size="*) ;;
*)
if [ -z "$NODE_OPTIONS" ]; then
export NODE_OPTIONS="--max-old-space-size=12288"
else
export NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=12288"
fi
;;
esac
if [ -f package.json ] && [ ! -d node_modules ]; then
echo "Installing npm dependencies..."
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi
fi
'';
}