https://hydra.nixos.org/job/nixos/release-22.05/nixos.sd_image.aarch64-linux
Download a recent image and extract it:
$ nix-shell -p zstd --run "unzstd nixos-sd-image-22.05.3389.9cac4585028-aarch64-linux.img.zst"
Write it to a USB stick, e.g.:
$ sudo dd if=./nixos-sd-image-22.05.3389.9cac4585028-aarch64-linux.img of=/dev/sda bs=1M status=progress
Just copy it to /home/nixos
.
It's also a good idea to clone personalise
and copy some contents for .ssh
into /home/nixos
.
After boot you will automatically be logged in as user nixos
. Become root via sudo su
.
Attach the device to install NixOS onto.
Run
# cd nixos-servers
# ./01-prepare-sd.sh <dev>
# ./02-install-nixos.sh <dev> <servername>
where <dev>
is the device to install onto (existing data will be wiped) and <server>
is the name of the server config to be used.
Shut down and remove the USB stick. Power the Pi again. We will now boot into the NixOS system on the ZFS pool on <dev>
. You can log in as a normal user now.