Foreword:
My NixOS experience is actually limited to this device. So this might not be this optimal and there are some parts of this that look a bit cringe to me and they might not be necessary but I left them here for now...
By the way: If you got a Pocophone F1 with EBBG display you will likely have to figure out a bit of stuff and then contribute to the Mobile NixOS repo. Most beryllium owners have a Tianma display.
Start on a aarch64 machine (e.g. SBC RPi 4):
Then e.g. this for phosh (hello actually has a few words on that iirc):
nix-build examples/phosh --argstr device xiaomi-beryllium -A outputs.default
fastboot flash boot result/boot.img
fastboot flash userdata result/system.img
I then took basically just cp -r
'd the examples while keeping my modifications in the examples dir.
What I got is largely identical to what I attached (files from phone) but the first 5 lines differ.
On phone:
mkdir ~/Projects
cd Projects
git clone https://github.com/NixOS/mobile-nixos #get PR: git fetch origin pull/$ID/head:$BRANCHNAME
git clone https://github.com/NixOS/nixpkgs
mkdir pocophone
cp mobile-nixos/pkgs.nix pocophone/pkgs.nix
cd pocophone
nano default.nix
nano configuration.nix
nano packages.nix # split into extra file for list of apps
sudo -s
ln -s /home/alice/Projects/pocophone/configuration.nix /etc/nixos/configuration.nix
nix-channel --add https://nixos.org/channels/nixos-23.11 nixos
nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
nix-channel --update
export NIX_PATH="nixpkgs=/home/alice/Projects/nixpkgs:mobile-nixos=/home/alice/Projects/mobile-nixos:nixos-config=/etc/nixos/configuration.nix"
nixos-rebuild switch