Partitioning Disks for NixOS
In order to use NixOS, you will have to initially partition the allocated disk space for the NixOS installation. I prefer to do this manually because it’s only a one-time setup and it’s easier to set up. However, you can also use tools like disko to declaratively partition your disks.
Partition the disk using
partedorfdisk. For example, if you have a disk at/dev/sda, you can use the following command:Terminal window sudo parted /dev/sda -- mklabel msdossudo parted /dev/sda -- mkpart primary ext4 1MiB 100%Format the partition:
Terminal window sudo mkfs.ext4 -L nixos /dev/sda1Mount the partition:
Terminal window sudo mount /dev/sda1 /mnt