NixOS

Better Image Building

I’ve managed to recently upgrade my image building process for this website, using some of what I have been learning about Nix. For a while while I was first learning to use Nix I thoguht of the language, the packages, and the OS as being one thing. And this did a disservice to both the breadth of what Nix offers as well as the capabilities it offers.

Old Paradigm

So previously with this site I used a fairly straightforward and manual process. I installed Hugo on my local machine with dnf, ran the dev server, and edited my pages. When I pushed the commits into GitHub, I had a Containerfile in the repository that would get built with Docker or Podman, pushing the resulting image to my image repository. I used a multi-stage file, first pulling the Hugo image to build the files and then grabbing the resulting build produts to place them into the Nginx image.

Nixos on Raspberry Pi 4

So I’ve been playing around with NixOS on a Raspberry Pi 4 that I have at the house. NixOS seems like a great idea, but getting it onto the Raspberry Pi 4 is something of a beast of a process. So I wanted to document here how I did it. Most of the process is the normal NixOS installation process, with a few tweaks at the very end.

My Pi’s Case is a Challenge

Rather than having a plain Raspberry Pi 4 and writing the SD image provided by the NixOS team to that image, I have my Pi in an [Argon One m.2](some link here) case. That case allows me to mount an m.2 SSD to an RPi4 B device over USB3. They’re pretty slick cases, decent quality, include full size HDMI ports and basic power management, and still allow GPIO header splitouts if you need them for your application. If you are looking for a handy little case that is metal, well built, functions as a heat sync, includes a tiny fan, and gives you the SSD USB3 split out, then I suggest you take a look at this case. They also have a version that does not have the SSD, but still gives you the port split out and is the same well built metal top enclosure.