Mobile NixOS: Breadth-First Development

Let's first preface this with a message to you, yes you, the one wondering why this is not part of the Mobile NixOS news or documentation. It's simple, this is my personal approach to my current development style, and is not an intrinsic part of the project.

Hardware is fun. There is an infinite variety of hardware, all differing in weird ways, exhibiting quirks, weirdness or some would say by design, sometimes.

When you're building a project for one particular device, most of this can be easily forgotten. A developer can easily end up writing a solution that only applies to the specific situation they are facing with. There is no real need to abstract away, you ain't gonna need it after all.

This is something I, from the very start, wanted to avoid with Mobile NixOS. What good would it be if, for every complete device port, I have tear down half of the implementation to fix divergences in implementation? I do need it.

That problem is why I am developing in a manner I call « Breadth-first development ». I am purposefully torturing myself with as varied an ecosystem I can, preventing ossification of bad assumption in the foundations.

Let me tell you something: it's not easy. I don't mean that it's hard to work with. It's not that much more complex than dealing with a single port. What's not easy is seeing progress sometimes seemingly advance at a snail's pace.

Though, this approach already paid its dividends. The infrastructure is already setup in a way that doesn't couple things tightly with any specific hardware, or even a broader system type like Android devices. Early on I decided I had to make sure everything worked on the varied assortment of devices I had.

Using this approach, I progressed in careful steps when first starting, waiting before I rush in and work on booting the rootfs. By doing so I was able to make it so the final booted system is somewhat isolated from the early boot, meaning that we can share the same system image for all devices sharing the same processor architecture. The Android devices, ChromeOS devices, and the Pinephone all can boot from the same rootfs.

This was a happy little accident. I did not intend to do this. I started by making all of the devices I had on hand boot to stage-1 (early boot). Only after I had a couple of those going, did I start working on stage-2 (the rootfs). As I was working, I observed that for two different systems, I had the same store path for the rootfs.

At that point I decided it was worth it to make it a goal. A generic, useful rootfs is now part of the basic setup for Mobile NixOS. All supported devices should be able to boot the sample rootfs. New non-upstreamed port should, too, be able to boot it.

Anyway, this wasn't a technical post, but only a smaller, more personal update, to share something that has been on my mind recently. There's no real conclusion. This is not a universal approach, and I don't think there's anything new or revolutionary.

Where are the Mobile NixOS updates?

I stopped updating this blog with the technical updates from my work, but instead update the project website with the monthly updates.

I thought I should say it, in the off chance someone only followed this blog, since I never announced that the development updates were moving there.