diff --git a/nonpure/install.sh b/nonpure/install.sh new file mode 100644 index 0000000..e8750b4 --- /dev/null +++ b/nonpure/install.sh @@ -0,0 +1,77 @@ +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" <