Skip to content

Commit

Permalink
doc: add a jupyter section
Browse files Browse the repository at this point in the history
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
teto committed Jan 2, 2024
1 parent 7c62bf3 commit 604d141
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/packages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ firefox.section.md
fish.section.md
fuse.section.md
ibus.section.md
jupyter.section.md
kakoune.section.md
linux.section.md
locales.section.md
Expand Down
32 changes: 32 additions & 0 deletions doc/packages/jupyter.section.md
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;
}
```

0 comments on commit 604d141

Please sign in to comment.