mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
83bd47a835
JUPYTER_PATH can be used to provide additional plugins for jupyter to use. Currently, JUPYTER_PATH is being unconditionally overridden, so extensions are not found, e.g: ``` $ JUPYTER_PATH="path to dir with labextensions/@jupyter-widgets" jupyter labextension list 2>&1 | grep widgets ``` Instead of setting JUPYTER_PATH, prepend to it, so JUPYTER_PATH will be respected: ``` $ JUPYTER_PATH="path to dir with labextensions/@jupyter-widgets" jupyter labextension list 2>&1 | grep widgets @jupyter-widgets/jupyterlab-manager v5.0.13 enabled OK (python, jupyterlab_widgets) ```
19 lines
478 B
Nix
19 lines
478 B
Nix
# Jupyter notebook with the given kernel definitions
|
|
|
|
{ python3
|
|
, jupyter-kernel
|
|
, definitions ? jupyter-kernel.default
|
|
}:
|
|
|
|
let
|
|
jupyterPath = (jupyter-kernel.create { inherit definitions; });
|
|
jupyter-notebook = (python3.buildEnv.override {
|
|
extraLibs = [ python3.pkgs.notebook ];
|
|
makeWrapperArgs = ["--prefix JUPYTER_PATH : ${jupyterPath}"];
|
|
}).overrideAttrs(oldAttrs: {
|
|
meta = oldAttrs.meta // { mainProgram = "jupyter-notebook"; };
|
|
});
|
|
in
|
|
|
|
jupyter-notebook
|