OnePlus OnePlus 3
Manufacturer

OnePlus

Name

OnePlus 3

Identifier

oneplus-oneplus3

System Type

android

SoC

qualcomm-msm8996

Architecture

aarch64-linux

Source

Mobile NixOS repository

Builds

Hydra (default build)

Building

This will build the default output for your OnePlus OnePlus 3.

$ nix-build --argstr device oneplus-oneplus3 -A build.default

Installation

The device will need to be booted in its bootloader, or fastboot, mode. The boot image can be installed using the following command, assuming it was built using the previous command.

$ result/flash-critical.sh

If you have a system image (system.img) built, you can use fastboot to flash it to the device. Note that it might be too big to fit over the system partition. In such case, it can be flashed on the userdata partition.

Warning
This will erase everything on the partition. Additionally, the common backups methods, e.g. TWRP, will not backup the userdata partition.
$ fastboot flash userdata system.img

Device-specific notes

Using fastboot to burn system.img to the userdata partition will fail.

It seems like it flashes successfully like other devices do, but the flashed image will not boot.

The current workaround is to fastboot boot TWRP and use dd through adb to flash the image.

 $ cat .../.system.img | adb shell dd of=/dev/block/by-name/userdata bs=8m