# Define the disk to partition DISK="/dev/sda" # Create a new partition table parted $DISK -- mklabel gpt # Create the EFI partition parted $DISK -- mkpart ESP fat32 1MiB 512MiB parted $DISK -- set 1 esp on # Create the root partition parted $DISK -- mkpart primary ext4 512MiB 100% # Format the EFI partition mkfs.fat -F 32 -n BOOT ${DISK}1 # Format the root partition mkfs.ext4 ${DISK}2 # Mount the partitions mount ${DISK}2 /mnt mkdir -p /mnt/boot/efi mount ${DISK}1 /mnt/boot/efi # Clone the configuration repository mkdir -p /mnt/etc/nixos git clone https://git.luke-else.co.uk/luke-else/nixos-config.git /mnt/etc/nixos # Install NixOS using the cloned configuration nixos-install --flake /mnt/etc/nixos#vm # Ensure the bootloader is installed nixos-enter --root /mnt -- nixos-rebuild boot # Reboot the system echo "Installation complete. Rebooting..." reboot