Edit from the future: For up-to-date information, please visit https://mobile.nixos.org/ where updates are being posted.
I have been chipping away at booting a nix-built system mobile devices. I don’t really know how to introduce the project, and it’s a bit early to have a complete demo. This builds heavily off the efforts of the postmarketOS project, and as a goal will try to keep building off that project, benefiting from their fixes, and conversely, upstreaming our work should be a goal.
First, I’ll need to disassemble the pile of hardcoding and hacks currently making it boot. It isn’t that high, but building on top of it is bound to hurt! This is mainly cleaning up the initramfs, making device quirks configurable and verifying by porting an armv7 device (which I already own).
The goal, then, is to boot a proper NixOS system, not to make a derivative distribution.
This project, repository and overlay will hold anything that doesn’t have as much value (initially) upstream. It will also hold any patches and fixes specific to mobile device compatibility. While this is true now, I wouldn’t be against working on upstreaming all this into nixpkgs and NixOS proper!
This currently has been developed with only one android device on hand, which means that I may be making architectural decisions that would hinder the integration of non-android-like system. This should be considered as a bug and fixed!
Furthermore, this is a big project, and I know there are some things I’m unfamiliar with, when doing nix derivation and builds. Please comment and critique my work, this should help me getting better with nix!
Don’t hesitate to contribute! If you have other devices which are postmarketOS compatible, and are interested, hit me up here, or on IRC.
Here’s the repo:
It is possible to build a
boot.img with an initramfs that will dump graphics into the framebuffer, start the android usb network thing, and start dropbear (with passwordless login).
This makes it possible to play around with the system, without even touching the internal storage.
Got the framebuffer configured properly. It was previously configured so that Red and Blue channels were swapped. In glorious potatovision, a pair of photos showing how the temporary splash screen looks like on my device. (Sure, this could easily be faked.) Now that I have the framebuffer looking right, I’m planning to refactor the hacks for the initrd and then looking into booting into stage 2.