23 lines
530 B
Bash
23 lines
530 B
Bash
# Assuming /dev/sda is the target disk
|
|
parted /dev/sda -- mklabel gpt
|
|
parted /dev/sda -- mkpart primary ext4 1MiB 100%
|
|
mkfs.ext4 /dev/sda2
|
|
mount /dev/sda2 /mnt
|
|
|
|
cryptsetup luksFormat /dev/sda2
|
|
cryptsetup open /dev/sda2 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 |