At this point of my NixOS journey, this is how I provision a new Notebook:
- Create Ventoy USB-stick
- Get the nixos-installer-x86_64-linux.iso nix-community image
- Add it to the ventoy stick and boot it
- It will setup a network, enable SSH and show a IP and password where the host
can be reached, e.g.
192.168.101.184
- Run
clan machines install limette --target-host root@192.168.101.184
from an existing NixOS machine inside your flake. It will ask for the password shown by the image - Done.
clan machines install
will automagically partition the disks, use kexec to
install nixos and deploy your full configuration, including provisioning secrets.
When all is done, the machine will reboot into your set up system and you are
ready to login.
This assumes you already have a working nixosConfiguration
for the
machine in your flake. In practice this is not a problem: I just copy one of the
existing ones, change the name and add a disko-configuration for the filesystem,
partitions and layout that I want to use. The disko
repository has a
lot of premade examples for common setups. Lately I have been using the
luks-btrfs-subvolumes.nix
layout, which sets up a LUKS encrypted btrfs
filesystem with some subvolumes.