NixOS on my phone?

It’s quickly becoming a reality! Look at the devices list to see if your device is already supported. Otherwise, read about the porting process to understand if you can get NixOS on your phone.

News Items

February 2020 round-up

March 3rd 2020

This update is the fourth in a series of regular updates on the state of the project.

Only changes that have been accepted and merged in Mobile NixOS are chronicled here. There’s always more work currently in-progress.

Notable changes

3 PRs were merged during the month. This is not cheating, the last merged PR was merged late on the 29th.

This is not development slowing down. Far from it. Four new projects were added to the Mobile NixOS GitHub organization related to this month’s work. Keep on reading.

Graphical boot selection

Hot on the heels of the re-written init, and as teased, a working graphical boot selection is now available for Mobile NixOS platforms.

There is more than meets the eye in pull request #80.

To make this possible, a GUI toolkit of relatively small weight has to be found. After some research, it was found in the LittlevGL library. While it is geared more towards actual embedded development, it does have a Linux framebuffer backend, support for evdev input. This is all standard stuff that is well supported on all targets. What is really nice with that library is it also supports a “simulator” target, which is basically an SDL window.

With that said, I personally don’t want to write C, especially in complex use cases. I already worked on mruby integration for the Mobile NixOS stage-1. It was only natural to write mruby bindings for LittleVGL.

With all the exposition done. What does this look like? The header image of this news post is composed of four devices running the GUI. An actual screenshot of the GUI follows, for better clarity.

Screenshot of generation selection

This is not a feature complete generic replacement for a bootloader. Though, it can become one when kexec support is added in the future.

Additionally, as touched upon in the pull request, these bindings will allow us to improve the graphical boot process. In a future improvement we’ll be able to add information about the current running step, and better failure state reporting.

Ports

No new port were made in February. There is still a total of 10 devices you can build for.

January 2020 round-up

February 4th 2020

This update is the third in a series of regular updates on the state of the project.

Usually, only changes that have been accepted and merged in Mobile NixOS in the given month are chronicled here. There’s always more work currently in-progress.

Notable changes

Only 1 PR was merged during the month. Though, keep on reading, as one of the biggest PR, started in mid-December, was the main focus of the month.

New Stage-1 init

This is quite the misnomer, while true, that the PR mainly introduced a completely re-done init, it brought much more.

  • "New-style" USB gadget (gadgetfs) handling.

  • USB Networking for newer devices.

  • Vendor partition firmware loading.

  • Logs multiplexing and saving in stage-1.

  • Proper reboot and poweroff in stage-1.

  • Actual handling of NixOS-configured specialFileSystems.

This new init is built using a dependencies-based system, reducing the complexities from the inflexible "big script" approach of the previous init. With this new approach, we can simply dump all of the things we need to happen in the init, tell them how they’re linked, and boot. The current implementation is naïve, but even with a naïve approach, the benefits are apparent. First, the developer does not need to care about the ordering of things, only describing what has to be, and what to do. Then, the relatively surprising part: this made things a bit quicker to boot.

This reduced reliance on sleep and wait times during the boot to provide assurance that things were ready, meaning that steps happen much quicker in succession. To the annoyance of the author, this means that the well-choreographed boot images whizz by too quickly, reducing their meaningfulness.

In the end, this is a hidden change, that serves mainly to ensure a rock-solid foundation for what’s coming soon.

See the PR for more details.

Upcoming changes

Speaking of coming soon, As previewed in a tweet, work is in progress to provide a graphical interface that can be used in early boot. This can be used to make a "recovery" system tailored to the project’s need, and more importantly, allow interaction in the boot process.

The main focus of early interaction is to allow selecting a generation to boot into. This is part of the NixOS experience, and is currently missing. Another benefit to an early UI is that it will give us the opportunity to enter a passphrase to unlock an eventually coming encrypted system.

Keep your eyes peeled for the coming PR!

Ports

No new port were made in January. There is still a total of 10 devices you can build for.

December 2019 round-up

January 8th 2020

This update is the second in a series of regular updates on the state of the project.

Only changes that have been accepted and merged in Mobile NixOS are chronicled here. There’s always more work currently in-progress.

Notable changes

Among the changes, and the 10 PRs merged, these changes are highlighted.

Make the demo more useful on a touch device

These are changes to the "example" system. This is a finalized version of the demo system that was running on the devices during NixCon 2019.

The main difference is that this is not a raw XFCE desktop, but a pre-configured system that is more accessible on touch devices. The onboard on-screen keyboard is configured to be of a useful height. Additionally, XFWM has been replaced with Awesome WM configured to maximize all windows.

This is still not an appropriate mobile environment, only a collection of configuration that makes it work well enough to test things up.

Read more in pull request #63.

Enhance QEMU Device

The x86_64 based QEMU VM has seen fixes to, first, make it actually work right.

What’s more interesting in this PR is the patched VGA BIOS that rotates the expected resolutions (720p, 1080p) on their side in portrait mode. This is especially helpful when working on purely software things like improving the example system.

These changes are part of pull request #59.

Different stage-1 fixes

The root filesystem is configured to expand to the size of its backing partition during boot. Part of pull request #61.

Critical failure states are graphically reported. As documented, a full-screen color-coded "sad phone" gives a general idea of the error encountered. Part of pull request #58.

Ports

One new device has been merged during December.

Bringing the total of devices to 10.

November 2019 round-up

December 3rd 2019

This update is the first of a series of regular updates on the state of the project.

Only changes that have been accepted and merged in Mobile NixOS are chronicled here. There’s always more work currently in-progress.

Notable changes

Among the changes, and the 10 PRs merged, these changes are highlighted.

initrd: add fbterm modules

When the new mobile.boot.stage-1.fbterm options are enabled, a userspace implementation of a console is started, attached to the output of tty1. As of right now, this is a read-only view of the console.

This is still extremely useful on targets where the kernel-based virtual consoles will not work. As long as the framebuffer is setup, you can use the console to observe what is going on.

Documentation and website framework

This was briefly highlighted in the last news item, though let’s describe how the documentation and website generation ticks.

The generated documentation in the repository is always built using the same exact tooling as the website. In fact, the website is only adding files to the documentation directory to build itself.

This gives us the advantage of the documentation being trivial to build locally.

~/.../mobile-nixos $ nix-build ./doc/
these derivations will be built:
  /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mobile-nixos-docs.drv
[...]
/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mobile-nixos-docs

~/.../mobile-nixos $ ls -l result/index.html
-r--r--r-- 4 root root 1541 Dec 31  1969 result/index.html

~/.../mobile-nixos/mobile-nixos-website $ xdg-open result/index.html
[...]

The documentation, minus the news items, will open in your web browser, and work just like this website. The styles, the site map, everything is generated 1:1 compared to the website.

The mobile-nixos-website repository holds the machinery that updates the site, in addition to the news items. This is where content specific for the website is written.

You may also want to subscribe to the new RSS feed.

New ports

Three new devices were merged this month.

The Pixel devices should be trivial to adapt to their respective non-XL and XL variants.

NixCon Wrap-Up and Website

November 15th 2019

This past October, on the 25th, a talk about Mobile NixOS was held at NixCon 2019, in Brno, Czechia. The talk was recorded and is on the NixCon YouTube page.

Bringing us to the next point: this new and shiny website. This is was described as the next step for the project. This website is built by blurring the difference between the documentation of the project and the website. This means that, hopefully, neither the website or the documentation will lag behind in relevance. Additionally, building the site and contributing should be as simple as contributing to the documentation. Hopefully simple enough.

Last, but not least, a few notes about the Hackday at the 2019 NixCon. I was left with approximately no time to work on things myself, but instead was found surrounded by bright individuals contributing neat stuff to the project. Those pull requests are a good sample of what was done, though early work on the OnePlus 5 was not advanced enough to be contributed back.

Wrapping this all nicely, I found that the main issue contributors around me had was the lack of documentation about the porting process. I knew it was an issue, hopefully this new website and progressing documentation helps.