NixOS has a great out-of-the-box support for ARM64v8 systems, but that comes with a catch: you have to use the prebuilt images to install the system, which are (obviously) not customizable, and come without OpenSSH enabled by default. Unfortunately, this requires to attach a display to the Raspberry Pi to complete an installation – not ideal! This article is the story of my journey to build a custom NixOS image for my Raspberry Pi, with all the pitfalls and errors I had to solve to eventually reach the objective.
I have spent the past few days working on building a custom image of NixOS for my Raspberry Pi, taking note of all the problems that I encountered along the way to write about it. It has certainly been an interesting experience, as I am building the image emulating AArch64 (or ARM64v8, the architecture of the Pi 3) with QEMU, so I wasn’t expecting a smooth ride at all. There was one particular problem, though, which had my head scratching for a while.