if [ "$(id -u)" -eq 1000 ]; then printf "switch to the root user, and try again.\n" exit 1 fi lsblk read -p "Drive name? (/dev/vda): " DRIVE read -p "NixOS configuration? (virtbox): " NIXOS_CONFIG read -p "Reboot? (yes/no, default 'yes'): " REBOOT umount -f /mnt/boot umount -f /mnt swapoff -a nix-env -iA nixos.git if [ -z "$DRIVE" ]; then DRIVE="/dev/vda" fi if [ -z "$NIXOS_CONFIG" ]; then NIXOS_CONFIG="virtbox" fi if [ -z "$REBOOT" ]; then REBOOT="yes" fi fdisk "$DRIVE" <