Work of samueldr to run NixOS on the Pine64 Pinebook Pro
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Samuel Dionne-Riel caa3d3e324 pinebook_pro.nix: Default to `_lts` build 3 months ago
firmware pinebookpro-firmware -> pinebookpro-ap6256-firmware 8 months ago
kernel kernel_latest: update nhp patches for Linux 5.12 8 months ago
keyboard-updater keyboard-updater: 2020-01-22 → 2021-07-28 5 months ago
sound Enable right speaker in reset script 2 years ago
.gitignore initial commit 2 years ago document keyboard controller 4 months ago
cross-hacks.nix Add workaround for smartmontools cross-compilation regression 1 year ago
default.nix Pin a known good Nixpkgs revision 3 months ago
overlay.nix u-boot: Remove customized build 8 months ago
pinebook_pro.nix pinebook_pro.nix: Default to `_lts` build 3 months ago
pkgs.nix Pin a known good Nixpkgs revision 3 months ago
system.nix Adds (incomplete) system image build 2 years ago
with-cross.nix Adds (incomplete) system image build 2 years ago

WIP stuff to get started on the pinebook pro.

Using in your configuration

Clone this repository somwhere, and in your configuration.nix

  imports = [

That entry point will try to stay unopinionated, while maximizing the hardware compatibility.

Current state

A whole lot of untested.

You can look at the previous state to see that the basic stuff works. But I find listing everything as working is hard.

What's untested and not working will be listed here at some point. Maybe.

Known issues

rockchipdrm and efifb

This can be worked around by booting with the efifb=off kernel command-line.

This is already handled for you by this configuration. If using the generic UEFI AArch64 iso, you will need to add the option yourself to the command-line using GRUB.

EFI and poweroff

When booted using EFI, the system will not power off. It will stay seemingly stuck with the LED and display turned off.

Power it off by holding the power button for a while (10-15 seconds).

Otherwise you might have a surprise and find the battery is flat!

A workaround exists, and is built in recent Tow-Boot (no prebuilt releases at this time).

Image build

NOTE: These images will be built without an Initial Boot Firmware.

SD image

 $ nix-build -A sdImage

ISO image

 $ nix-build -A isoImage

Note about cross-compilation

This will automatically detect the need for cross-compiling or not.

When cross-compiled, all caveats apply. Here this mainly means that the kernel will need to be re-compiled on the device on the first nixos-rebuild switch, while most other packages can be fetched from the cache.

For cross-compilation, you might have to provide a path to a known-good Nixpkgs checkout. (Left as an exercis to the reader.)

 $ NIX_PATH=nixpkgs=/path/to/known/working/cross-compilation-friendly/nixpkgs

Initial Boot Firmware

NOTE: The previously available customized U-Boot from this repository are not available anymore.


I highly suggest installing Tow-Boot to the SPI Flash.

Having the firmware installed to SPI makes the device act basically like a normal computer. No need for weird incantations to setup the initial boot firmware.

Alternatively, starting from the Tow-Boot disk image on eMMC is easier to deal with and understand than having to deal with U-Boot manually.

Mainline U-Boot

Mainline U-Boot has full support for graphics since 2021.04. The current unstable relases of Nixpkgs are at 2021.04 at least.

 $ nix-build -A pkgs.ubootPinebookPro

Note that the default U-Boot build does not do anything with LED on startup.

Keyboard firmware

WARNING: Some hardware batches for the Pinebook Pro ship with the wrong chip for the keyboard controller. While it will work with the firmware it ships with, it may brick while flashing the updated firmware. See this comment on the firmware repository.

It is unclear how to identify said hardware from a running system.

To determine which keyboard controller you have, you will need to disassemble the Pinebook Pro as per the Pine64 wiki, and make sure that the IC next to the U23 marking on the main board is an SH68F83.

 $ nix-build -A pkgs.pinebookpro-keyboard-updater
 $ sudo ./result/bin/updater step-1 <iso|ansi>
 $ sudo poweroff
 # ...
 $ sudo ./result/bin/updater step-2 <iso|ansi>
 $ sudo poweroff
 # ...
 $ sudo ./result/bin/updater flash-kb-revised <iso|ansi>

Note: poweroff must be used, reboot does not turn the hardware "off" enough.