Arch/Nix enthusiasm: pacman -R ghc

Posted on September 20, 2016

I am an Arch Linux user. I am also a NixOS user. But Arch is my primary workstation, since it gives me access to packages which are not yet available for Nix, and which I don’t have the time (deadlines!) to make work in nix.

So, for work, I am an Arch/Nix user. At home it’s just NixOS now.

Cutting The Cord

Today I ran a command that I would have balked at a year ago:

pacman -Rns ghc cabal-install

Don’t get me wrong, I still use haskell all the time. I just don’t need Arch to know about it anymore. All my haskell projects have a default.nix expression now. They sometimes even use non-standard versions of GHC. Their packages probably conflict terribly now, no less.

But since nix now manages all of that, I no longer need haskell to be installed globally.

Internet Computing

Part of this has come from a simple line of inquiry that was answered on #nixos recently; and represented a revelation for me:

nixos-guest> What is the best VNC client for NixOS?
nixos-vetran> nixos-guest: nix-shell -p tigervnc --command vncviewer

This gave me pause. I had never thought of that. But why not! Install a program for only as long as it takes to run it? Brilliant! This is the internet age! This is Nix! This is … (buzzword cringe) game-changing!

Single-dependency deployment

The final piece of the puzzle, the last thing that I neded to nix-ify to remove the system-wide dependency on haskell was this blog. Now, the deployment script is just:

set -e
rsync -avr result/

I could probably make a further environment to combine the blog’s generation and rsync and remove rsync from my system as well – but I use rsync enough in my shell that it will likely remain installed – though only with nix-env.

Now I have only one dependency for all my personal projects: nix