I finally got around to expanding my nixos-auto-install project to allow for different hardware profiles.
In the past I had been editing the various files to install to /dev/sda
or /dev/nvme0n1
or whatever the case may be - but this is annoying so I wrote a short bit of python to loop through a yaml file and build a seperate iso for each profile:
sda-standard:
root_device: /dev/sda
root_size: 100%
k8s:
root_device: /dev/nvme0n1
root_size: 100GB
qemu:
root_device: /dev/sda
root_size: 100%
nixos-auto-install > just
black .
All done! ✨ 🍰 ✨
1 file left unchanged.
flake8 . --ignore=E501,W503
nix-shell . --run 'python3 main.py'
building sda-standard
sda-standard finished
building k8s
k8s finished
building qemu
qemu finished
In the future I’ll add mbr/uefi features as needed. I’m currently still avoiding uefi on my own computers.
The qemu
profile is for testing the iso in kvm:
just test
It should build the images and boot qemu.iso
in a simple qemu ‘one-liner’ VM.