Interactive online version Binder badge. Generated from tutorials/00-intro/01-getting-started.ipynb.

Getting started

This page contains tutorials showing how to use Nix and Nixpkgs. The tutorials were written as Jupyter Notebooks so they can be used interactively.

If you just want to read the tutorials instead of interactively use them, or you are already familiar with Jupyter Notebooks, then you can skip this tutorial and proceed with the actual tutorials regarding Nix and Nixpkgs.

What is a Jupyter Notebook?

A Jupyter Notebook is a document that, aside from text and figures can also contain interactive content and code. A notebook consists of cells and each cell has a type, e.g. code or markup. Code cells, when executed, can generate output. The output is recorded in the notebook.

How about the static website?

Now, the static website is generated by simply evaluating the notebooks and converting input and output to html. The interactive tutorials on the other hand are actual notebooks that are provisioned using Binder.

How do I use these tutorials interactively?

Every tutorial on this page, including this one, has a “launch binder” button at the top. Press it, and after some time (it typically takes 10 seconds or more) a notebook is opened and you see the tutorial, minus output.

To evaluate a cell, select a cell and press the “Run” button at the top. We can test this with the following cell

[1]:
! echo "hello!"
hello!

To evaluate more than one cell, e.g. all the cells, see the “Cell” menu at the top.

[2]:
! echo "One"
One
[3]:
! echo "cell"
cell
[4]:
! echo "of"
of
[5]:
! echo "many"
many

My notebook hangs, what now?

It may happen the notebook hangs, there is no output or something weird is going on. If that’s the case, open the “Kernel” menu and restart the kernel.

That’s it!

Now you know all there is to know about using the tutorials interactively. Good luck!