-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
we have many kernels available and nixpkgs should be a good way to configure software as complex as jupyter. Right now our API is not straightforward and thus needs documenting. This is not the final doc, it's an initial PR to bootstrap the effort and refine the nixpkgs API for jupyter. future work: document how to wrap jupyter-notebook
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# jupyter {#sec-jupyter} | ||
|
||
Jupyter has different frontends that can be configured: jupyter-console and | ||
jupyter-notebook. The approach is the same: | ||
1. create a folder that contains all the jupyter kernels | ||
2. wrap the executables | ||
|
||
```nix | ||
let | ||
definitions = { | ||
python = jupyterLib.mkKernelFromPythonEnv (python3.withPackages(ps: [ | ||
ps.numpy ]); | ||
haskell = jupyterLib.mkKernelFromHaskellEnv (pkgs.haskellPackages.ghcWithPackages(hs: [ hs.aeson | ||
]); | ||
# ... and all other kernels you are interested in | ||
}; | ||
myKernels = jupyter-kernel.create { | ||
inherit definitions; | ||
}; | ||
in | ||
# pseudocode, real code in next sections | ||
jupyter frontend wrapped with JUPYTER_PATH=myKernels | ||
``` | ||
|
||
|
||
## How to run jupyter-console with arbitrary kernels ? {#sec-jupyter-console} | ||
|
||
```nix | ||
myJupyterConsole = jupyter-console.mkConsole { | ||
inherit definitions; | ||
} | ||
``` |