# Define the disk to partition DISK="/dev/sda" # Create a new partition table parted $DISK -- mklabel gpt # Create the root partition parted $DISK -- mkpart primary ext4 512MiB 100% # Create the EFI partition parted $DISK -- mkpart ESP fat32 1MiB 512MiB parted $DISK -- set 2 esp on # Format the root partition mkfs.ext4 ${DISK}1 # Format the EFI partition mkfs.fat -F 32 -n BOOT ${DISK}2 # Mount the partitions mount ${DISK}1 /mnt mkdir -p /mnt/boot mount ${DISK}2 /mnt/boot # 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 # Reboot the system echo "Installation complete. Rebooting..." reboot