-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshell.nix
More file actions
39 lines (35 loc) · 1.04 KB
/
Copy pathshell.nix
File metadata and controls
39 lines (35 loc) · 1.04 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
let
pkgs = import <nixpkgs> { };
in
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs-slim_latest
pnpm
python3
python314Packages.jupyterlab
];
shellHook = ''
export JUPYTER_DATA_DIR="$(pwd)/.jupyter/data"
export JUPYTER_CONFIG_DIR="$(pwd)/.jupyter/config"
export TSLAB_RUNTIME_DIR="$(pwd)/node_modules/.bin/tslab"
mkdir -p "$JUPYTER_DATA_DIR/kernels/tslab"
mkdir -p "$JUPYTER_DATA_DIR/kernels/jslab"
cat > "$JUPYTER_DATA_DIR/kernels/tslab/kernel.json" <<EOF
{
"argv": ["$TSLAB_RUNTIME_DIR", "kernel", "--config-path", "{connection_file}"],
"display_name": "TypeScript",
"language": "typescript"
}
EOF
cat > "$JUPYTER_DATA_DIR/kernels/jslab/kernel.json" <<EOF
{
"argv": ["$TSLAB_RUNTIME_DIR", "kernel", "--config-path", "{connection_file}", "--js"],
"display_name": "JavaScript",
"language": "javascript"
}
EOF
cat > "$JUPYTER_CONFIG_DIR/jupyter_server_config.py" << EOF
c.FileCheckpoints.checkpoint_dir = ".jupyter/checkpoints"
EOF
'';
}