Welcome to my NixOS Mobile Configuration! This repository represents my personal NixOS configuration for my oneplus6, crafted to suit my needs and preferences. I have included the steps I took to get NixOS running on my phone. I hope you find this useful!
⭐ & ❤️ from: 0xKyran
note: The repo requires a lot of cleanup, but it works for now.
note: if you dont have an AARCH machine see aws-server
adb reboot bootloader
to reboot your phone into the bootloaderfastboot oem unlock
to unlock your bootloadernote: this will wipe and reset your phone and you will need to re-enable developer options and USB debugging
download TWRP
run adb reboot bootloader
to reboot your phone into the bootloader
run fastboot boot twrp-3.7.0_11-0-enchilada.img
to boot into TWRP
download copy-partitions-20220613-signed.zip
in TWRP go to Advanced -> ADB Sideload and swipe to start sideload
run adb sideload copy-partitions-20220613-signed.zip
return to the bootloader
remove the following partitions: dtbo_a
and dtbo_b
with:
fastboot erase dtbo_a
fastboot erase dtbo_b
clone this repo with git clone git@github.com:0xKyran/nixos-mobile.git
Allow unfree and insecure packages with:
export NIXPKGS_ALLOW_UNFREE=1
export NIXPKGS_ALLOW_INSECURE=1
build the images with nix-build --argstr device oneplus-enchilada -A build.android-fastboot-images
cd into the result
directory
run ./flash-critical.sh
to flash the boot image
run fastboot flash userdata system.img
to flash the system image
run fastboot reboot
to reboot your phone into NixOS
If you dont have an AARCH64 machine you can use an AWS server to build the images.
This is the configuration I used: configuration.nix
note: You have to use a aarch64 instance, I used t4g.2xlarge but you can use a smaller instance if you want.
note: You will need some storage, I used 80GB but you can use less if you want.
note: Bigger instances will build faster but have a higher cost per hour.