-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshell.nix
35 lines (33 loc) · 881 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
{
system ? builtins.currentSystem,
}:
let
pins = import ./nix;
pkgs = import pins.nixpkgs {
inherit system;
};
inherit (pkgs) stdenv lib;
in
pkgs.mkShell {
nativeBuildInputs =
with pkgs;
[
npins
jdk17
nodejs_18
typescript
]
++ (lib.optionals stdenv.isDarwin [
pkgs.libiconv
pkgs.darwin.apple_sdk.frameworks.Security
]);
shellHook = ''
export JAVA_HOME="$(readlink -e $(type -p javac) | sed -e 's/\/bin\/javac//g')"
# there is a nix bug that the directory deleted by _nix_shell_clean_tmpdir can be the same as the general $TEMPDIR
eval "$(declare -f _nix_shell_clean_tmpdir | sed 's/_nix_shell_clean_tmpdir/orig__nix_shell_clean_tmpdir/')"
_nix_shell_clean_tmpdir() {
orig__nix_shell_clean_tmpdir "$@"
mkdir -p "$TEMPDIR" # ensure system TEMPDIR still exists
}
'';
}