Nix derivation for reproducible Jupyter notebook

I created a Nix derivation for running a Jupyter notebook with support for all the libraries used by this course, including pytorch, fastai, numpy, matplotlib, etc.

https://github.com/cdepillabout/course-v3/blob/6ecf90f640f327dc05b167f45fb7ba88bc265281/default.nix

I wrote a short blog post showing how to use it:

https://functor.tokyo/blog/2019-03-16-nix-derivation-for-fastai

This should be useful for anyone wanting an easy, reproducible way to get a Jupyter notebook running with support for fastai, pytorch, CUDA, etc.


If you’ve never used Nix before, it is a package manager coupled with a programming language for specifying how to build Linux packages. You can think of it as a fully-programmable package manager. It is sometimes used as a replacement for things like Puppet, Ansible, Docker, etc. Nix derivations normally pin all the versions of libraries and packages they depend on, so they really are “fully reproducible” in a way that just normal Jupyter notebooks may not be.

If you’re a Nix-user but a beginner with Python (like me), the above derivation will give you a quick way to start going through the fast.ai course. (However, if you’ve never used Nix, I highly recommend you ignore this and just use the server setup as recommend by fast.ai!)

1 Like