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:
configuration.nix
for your first install.
</aside>First of all switch into root with sudo -i
since most of the install commands in the terminal have to be ran as root.
ping mynixos.com
, quit with Ctrl-c<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):
/
) – main systemBut 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.
lsblk
to verify the name of your main drive (usually called ‘sda’)cfdisk /dev/sda
(or the name of your drive in place of sda)gpt
if you are on UEFi
boot mode. If you’re on older BIOS
then select dos
(or MBR).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).
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
.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
.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.Write
and Enter, type “yes” and enter again. And finally you can Quit
.