Nix is awesome, and you should too

April 21, 2016

Here's why Nix is great.

Let's say I want to do a thing, but that thing requires stuff:

$ git clone
$ cd pandoc_resume
$ vim
$ make resume.pdf
make: command not found

Well, shoot. I don't have make installed. Even if I did, this project's Makefile requires both pandoc and context, and I don't have those installed either.

I don't really want to have to install make, pandoc, and context just to try this thing out. With Nix, I don't have to.

Let's try running make again, letting Nix handle the dependencies:

$ nix-shell -p gnumake pandoc texLiveFull --run 'make resume.pdf'

It worked! But now I have make, pandoc, and context installed, right? I didn't want that.

$ make
make: command not found

$ pandoc
pandoc: command not found

$ context
context: command not found

Nope! Immutable configuration is immutable.

Note: context might need mtxrun --generate run once before it's used.