root@main:~ # vm create -t debian -s 100G nixos
root@main:~ # vm iso /stuff/downloads/nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso
root@main:~ # vm -f install nixos nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso
determine the 'init' executable path from '(cd0)/isolinux/isolinux.cfg'. look for a line which start's with: 'APPEND init=/nix/store/.....'
grub> cat (cd0)/isolinux/isolinux.cfg
SERIAL 0 38400
TIMEOUT 100
UI vesamenu.c32
MENU TITLE NixOS
MENU BACKGROUND /isolinux/background.png
DEFAULT boot
LABEL boot
MENU LABEL NixOS 18.03.132192.ce0d9d638de Installer
LINUX /boot/bzImage
APPEND init=/nix/store/g0g54c7aqrb2vizl5qb2fcyf6pqs6x32-nixos-system-nixos-18.03.132192.ce0d9d638de/init root=LABEL=NIXOS_ISO boot.shell_on_fail loglevel=4
INITRD /boot/initrd
.....
grub> # linux (cd0)/boot/bzImage <USE THE VALUE FROM YOUR 'APPEND' LINE !!!!>
grub> linux (cd0)/boot/bzImage init=/nix/store/g0g54c7aqrb2vizl5qb2fcyf6pqs6x32-nixos-system-nixos-18.03.132192.ce0d9d638de/init root=LABEL=NIXOS_ISO boot.shell_on_fail loglevel=4
grub> initrd (cd0)/boot/initrd
grub> boot
note: i use a swapfile and i use only one partition
[root@nixos:~]# parted -s /dev/sda -a optimal -- mkpart primary ext4 1 -1s
[root@nixos:~]# mkfs.ext4 /dev/sda1
[root@nixos:~]# mount /dev/sda1 /mnt/
[root@nixos:~]# nixos-generate-config --root /mnt/
[root@nixos:~]# dd if=/dev/zero of=/mnt/swapfile bs=1M count=1000
[root@nixos:~]# chmod 0600 /mnt/swapfile
[root@nixos:~]# mkswap /mnt/swapfile
[root@nixos:~]# swapon /mnt/swapfile
add the following snippets to /mnt/etc/nixos/configuration.nix
boot.loader.grub.device = "/dev/sda";
swapDevices = [ { device = "/swapfile"; size = 1024; } ];
[root@nixos:~]# nixos-install