- Create a new disk image (I use VDI for compatibility with VirtualBox)
- Allocate some RAM (>6 GiB to start)
- Add some video memory and enable 3D acceleration, if needed
- Optional: Enable EFI (instead of BIOS)
- Attach
nixos-minimal
ISO for installation
- Boot into the ISO
sudo su # assume root
parted /dev/sda -- mklabel gpt
parted /dev/sda -- mkpart primary 512MiB -8GiB
parted /dev/sda -- mkpart primary linux-swap -8GiB 100%
parted /dev/sda -- mkpart ESP fat32 1MiB 512MiB
parted /dev/sda -- set 3 esp on
mkfs.ext4 -L nixos /dev/sda1
mkswap -L swap /dev/sda2
mkfs.fat -F 32 -n boot /dev/sda3
mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
swapon /dev/sda2
nixos-generate-config --root /mnt
vim /mnt/etc/nixos/configuration.nix
# set the below inside the configuration.nix
# make sure that `boot.loader.grub.*` are all commented out
## boot.loader.systemd-boot.enable = true;
## boot.loader.efi.canTouchEfiVariables = true;
## boot.loader.timeout = 2;
## nix = {
## package = pkgs.nixUnstable;
## extraOptions = "experimental-features = nix-command flakes";
## };
## virtualisation.virtualbox.guest.enable = true;
nixos-install # now, wait a while
The UEFI was turned off by VBox settings :)