# Assuming /dev/sda is the target disk parted /dev/sda -- mklabel gpt parted /dev/sda -- mkpart primary ext4 1MiB 100% mkfs.ext4 /dev/sda1 mount /dev/sda1 /mnt cryptsetup luksFormat /dev/sda1 cryptsetup open /dev/sda1 root mkfs.ext4 /dev/mapper/root mount /dev/mapper/root /mnt mkdir -p /mnt/etc/nixos git clone https://git.luke-else.co.uk/luke-else/nixos-config.git /mnt/etc/nixos nixos-generate-config --root /mnt nixos-install --flake /mnt/etc/nixos#vm passwd reboot # sudo nixos-rebuild switch --flake ~/nixos-config#vm