This article was originally published on
TL;DR If you don’t want to read how I’ve got to use Nix and general information
about it but only focus on its use to setup a development environment, please
jump to Using Nix. Even from that part, the reading can take some time as I
wanted to share what I’ve learned and found useful accross two months of
intensive usage. I had some initial questions I have answered to after reading a
great portion of the documentation or asking to people. I wanted to share them
with you so you can get into using Nix quickly, still understanding what you are
Two years ago, whenever I needed to use some language or tool which wasn’t
available on my machine, I would have used the system’s package manager to
install it. It worked on my computer, but when I needed to reproduce the setup
elsewhere it was another story. I was still a student then.
I remember a group project in which we were using Node.js. I had a recent
version installed on my Mac via Homebrew, while at the university and on other
student’s computer based on Ubuntu Linux, it was installed from the default
repos. Then, my code using default parameters in functions would run on my
machine but not on other’s, since their Node.js version was greatly outdated.
Using this approach can quickly become a nightmare, especially when you try to
write a documentation on how to set up the development environment. You end up
writing things like: “If you are on macOS please do this, on Debian do that, and
Fedora run this other command.” You can verify it works now, but there is no
guarantee it will still work in a few months.