Nix tutorial

Note

Any question, remark, or improvement suggestion? Feel free to discuss with us on the nixtm mattermost or open an issue/mr in the nix tutorial gitlab group.

This tutorial presents how Nix can help in the making of repeatable experiments. We propose here to use Nix to define software pieces and to control the environments into which the experiment is run. Even if this is possible, we chose not to use Nix to store the experiment input and output data in this tutorial.

Please note that Nix is not magic, it cannot do miracles with non-deterministic software pieces and has its limitations. Here is what Nix can provide to do experiments.

  • Fully defined user-space software environments. It means you can trivially reenter into the environment from which you run your experiment three years ago: No package version clash nor missing dependency.
  • Shareable user-space software environments. Define a pure environment on your laptop, then use it smoothly on Grid‘5000 clusters or continous test infrastructures.
  • Nix can be used in conjunction with other tools.
    • Full kernel control cannot be achieved with Nix alone (NixOS is meant for this), but combining Kameleon and Nix makes it possible.
    • Defining a Docker image that uses Nix packages is straightforward.