Download the minimal ISO image. The graphical installer doesn’t let you manually handle partitions which will be covered here. To write the ISO onto a USB, I use Etcher, but you can use whatever you want. Plug in your USB, select flash from drive on Etcher, then choose your ISO image you just downloaded, then select a target and pick your USB. Finally click flash and you are done. Now just boot that in whenever you’re ready.

<aside> 💡

Installation on NixOS is a sequence of 4 steps:

First of all switch into root with sudo -i since most of the install commands in the terminal have to be ran as root.

Partition

<aside> 💡

Before you begin, check what boot mode you are on(UEFI or BIOS). If you’re not sure, then type ls /sys/firmware/efi/efivars. If you get an error saying the directory doesn’t exist, then you are on BIOS.

You need to create three partitions(for UEFI) or only two partitions(if you’re on BIOS):

  1. EFI System Partition (ESP) – for boot loading (skip if you are on BIOS)
  2. Swap – for virtual memory
  3. Root (/) – main system

But note: BIOS systems do not use an EFI partition. So you can skip step 4 below.

</aside>

To partition, the nix manual recommends using parted. But I prefer to use cfdisk instead which uses a nice terminal-based GUI and is more straightforward.

  1. type lsblk to verify the name of your main drive (usually called ‘sda’)
  2. type cfdisk /dev/sda (or the name of your drive in place of sda)
  3. Then in the ‘select label type’ popup, select gpt if you are on UEFi boot mode. If you’re on older BIOS then select dos (or MBR).
  4. In the new screen, Hover over Free space. Hit enter to create a new partition, now type the partition size for the bootloader: 0.5G usually, then hit enter again to confirm. Then navigate to type and enter. Change the type to EFI System (this is only for UEFI boot mode).
    1. If you are on BIOS and you accidentally picked gpt in step 3. Then you do have to create a partition here, but the steps are different: Hit enter to create a new partition. Make the size: ~ 1M. And change the type to bios_grub.
  5. Now go down to Free space again and hit Enter to create a new partition. Enter the size for your swap partition: 4G(good for 8-16gb RAM) then Enter. go to type again and select Linux swap.
  6. The last partition is your main system, and it uses the remaining free space. So hit Enter on Free space twice to use the full memory space remaining. And you don’t need to change the type this time because this is a Linux filesystem by default.
  7. Now you want to write these partitions into memory. So navigate to Write and Enter, type “yes” and enter again. And finally you can Quit.