Weekly Journal 163 - Nix

Nix

I went to a local Linux user group meeting this week and saw a great NixOS introduction. I haven’t taken the plunge with NixOS just yet, but the talk gave me some ideas I want to explore further using the Nix package manager.

shell.nix

The first topic I want to explore more is building repeatable development environments using Nix. So far I have a working Nix shell configuration that installs a few dev tools and integrates with direnv for activation, but I would like to add more to it in order to have a repeatable process for setting up custom development environments. I’ve been using Docker containers to build these sorts of environments, but containers have their own challenges for local use. This feels like a cleaner way to build and manage these environments without resorting to external tools like asdf and language-specific tools like nvm, rbenv, etc.

Building containers with Nix

Speaking of containers, I am interested in exploring the use of Nix to build containers. According to the articles I’ve seen on the topic, you can use Nix from within a Containerfile/Dockerfile to do the heavy lifting instead of having all of the commands in the Containerfile directly. In theory, I could have a Nix configuration that is shared to build local environments and containers.

Building Raspberry Pi images with Nix

This one I haven’t looked into yet. I know there are Raspberry Pi installer images for NixOS, but I would like to use Nix to install a set of packages, perform some custom configuration, and then turn the results into a disk image that I can copy to a microSD card.

These are the ideas I had after the user group meeting. Hopefully I’ll have the chance to work on them in the near future.