Nix ±Cabal

August 7, 2015

James Earl Douglas, Technical Lead at the Wikimedia Foundation, shares his recent experience using Nix to manage system state. He discusses installing it in Ubuntu, using Nix to install other packages, and finally how it interacts with GHC and Cabal.

See the slides here.


  • A newcomer’s perspective on nix
  • Cabal can be difficult to use and nix helps alleviate that pain
  • Nix is purely functional
    • Packages never change
    • Helps resolve version conflicts of tools (like ghc) and libraries (like base)
  • Each package is stored in a unique, read-only directory
  • Packages have a hash that forever identify both them and their dependencies
  • Within NixOS itself
    • Everything lives in a nonstandard place, even bash
    • No more “hash-bang-bin-bash” — use the env command
  • Getting started on Ubuntu
    • Install by curling and running a shell script
    • Installing ghc and cabal from scratch with the nix-env command
    • Making specific packages visible with nix-shell
  • Examples of Nix configuration and expressions