1. Home
  2. Linux
  3. Install nixos linux

How to Install NixOS Linux on a PC With a USB Drive

If you want to learn how to install NixOS Linux, this guide will walk you through every step. NixOS is a fresh operating system — not a derivative, but a new take on Linux. It ships with a variety of different desktop environments and tries its best to offer a unique, efficient experience.

The NixOS project has a lot of goals, but the main focus is consolidating user configuration files in a universal space for ease of use, stability, reliability, and most importantly, a developer-friendly workflow.

Downloading NixOS

To get your hands on it, you’ll need to go to the official website. Once on the official NixOS Linux website, look for the “Get NixOS” button and click on it with the mouse to be taken to the downloads page.

On the downloads page, you’ll need to make two decisions before downloading: which ISO type and which architecture.

Graphical ISO vs Minimal ISO: The Graphical ISO boots into a full live desktop and launches the Calamares graphical installer — the easiest path for most new users. The Minimal ISO drops you straight to a terminal and is intended for manual or scripted installs. This guide covers both paths. If you’re unsure, start with the Graphical ISO.

Architecture: Most modern laptops and desktops use x86_64. If you’re installing on ARM hardware (such as an Apple Silicon Mac or a Raspberry Pi), select the aarch64 image instead. The download page lists separate links for each.

Verifying your download: Before flashing your USB, it’s worth verifying the ISO against the SHA-256 checksum listed on the official download page. On Linux or macOS, run sha256sum nixos-*.iso and compare the output to the checksum shown on the site. On Windows, use Get-FileHash in PowerShell. This confirms the file wasn’t corrupted or tampered with in transit.

Once you’ve selected the right image for your system, click the download link to start the process. ISO sizes change with each release, so expect the download to take a few minutes depending on your connection. When it’s complete, the ISO file will appear in your Downloads folder.

How to Install NixOS Linux: Making the Live Disk

Now that you’ve got your hands on the latest NixOS file, it’s time to create a bootable USB so that the operating system will work on your PC. To do this, start by heading over to the Etcher.io website and download their app.

Extract the Etcher application and run it on your Mac, Linux, or Windows PC. Then, while it’s running, follow the step-by-step instructions to learn how to create a bootable disk.

how to install NixOS Linux using Etcher to create a bootable USB

Step 1: Find the blue “Select image” button inside of the Etcher application and click on it with your mouse.

Step 2: After clicking on “Select image,” use the pop-up window that appears to browse for the NixOS ISO image on your system and click the “Open” button to add it.

Step 3: Take your USB flash drive out (of at least 2GB in size) and plug it into your computer.

Step 4: Locate the “Select drive” button in the Etcher application, and use the integrated pop-up menu to select the flash drive.

Step 5: Locate the “Flash!” button, and click it with the mouse to start the burning process! When everything is complete, reboot your Linux PC and configure it to load from USB.

How to Install NixOS Linux: Partitioning and Setup

Before you run the installer, you’ll need to partition your hard drive correctly. Understanding the partition layout is one of the most important steps when learning how to install NixOS Linux on a new machine.

When you boot from the NixOS USB, you have two paths depending on which ISO you downloaded:

(a) Graphical ISO: The system boots directly into a live desktop environment. From there, launch the Calamares installer from the desktop or application menu and follow the on-screen prompts. Note that the live desktop shown at boot does not determine which desktop environment gets installed on your disk — you choose that inside the installer. If you’re using the Graphical ISO and Calamares, you can skip the manual partitioning and terminal steps below, as the installer handles them for you.

(b) Minimal ISO / manual install: You’ll land at a terminal prompt. Continue with the partitioning, mounting, and configuration steps below to complete the install manually.

If you’re on the manual path, open a terminal and use GParted or fdisk/parted to set up your partitions. The layout you need depends on whether your system uses UEFI or BIOS firmware.

UEFI/GPT Layout

In the partitioner, create the following partitions on your target disk:

  1. Select the hard drive you want to install NixOS on in the menu on the top right.
  2. Select “Create Partition table” and set it to GPT.
  3. Right-click on the unallocated space and select “New” to create a new partition. Set the file system to FAT32, the label to boot, and the size to 512 MiB. Click OK, then click the checkmark to apply.
  4. Right-click the boot partition and select “Manage flags.” Enable both the boot and esp flags.
  5. Right-click the remaining free space and select “New.” Set the file system to linux-swap, the label to Swap, and the size to 4096 MiB (4 GB). Click OK, then the checkmark to apply.
  6. Right-click the remaining free space and select “New.” Set the file system to Ext4 and the label to Root. Allow it to use the rest of the drive. Click OK, then the checkmark to apply.
  7. Right-click the Swap partition and select “Swapon” to activate it.

The result will be three partitions: a 512 MiB FAT32 EFI partition, a swap partition, and an Ext4 root partition.

BIOS/MBR Layout

If your system uses legacy BIOS firmware, you do not need an EFI System Partition.

  1. Select the hard drive you want to install NixOS on in the menu on the top right.
  2. Select “Create Partition table” and set it to MS-DOS (MBR).
  3. Right-click on the unallocated space and select “New.” Set the file system to linux-swap, the label to Swap, and the size to 4096 MiB. Click OK, then the checkmark to apply.
  4. Right-click the remaining free space and select “New.” Set the file system to Ext4 and the label to Root. Allow it to use the rest of the drive. Click OK, then the checkmark to apply.
  5. Right-click the Swap partition and select “Swapon” to activate it.

Note: if you are using a GPT disk with a BIOS system (for example, a disk over 2 TB), you will also need to create a small (1 MiB) partition with no filesystem before the root partition and set its flag to bios_grub. Most users on BIOS hardware should simply use MBR as described above.

With the partitioning done, close GParted and open a terminal. Run the lsblk command to confirm your partition layout.

lsblk

Note: on systems with NVMe drives, your partitions will have names like /dev/nvme0n1p1, /dev/nvme0n1p2, and /dev/nvme0n1p3 instead of /dev/sda1, etc. Substitute the correct device names for your hardware throughout the commands below.

Using the mount command, mount your partitions to the /mnt folder.

UEFI/GPT — mount example (where /dev/sda1 is EFI, /dev/sda2 is swap, /dev/sda3 is root):

mount /dev/sda3 /mnt
mkdir -p /mnt/boot
mount /dev/sda1 /mnt/boot

BIOS/MBR — mount example (where /dev/sda1 is swap and /dev/sda2 is root — no boot partition exists):

mount /dev/sda2 /mnt

Run the nixos-generate-config command to create a new config file.

nixos-generate-config --root /mnt

Open the configuration file with Nano.

nano -w /mnt/etc/nixos/configuration.nix

Make the following edits to the configuration file.

For UEFI users

In the config file, remove the # from:

  • networking.hostName = "nixos"; < – be sure also to change “nixos” to your preferred hostname.
  • networking.wireless.enable = true <- if you require WiFi.

For BIOS users

In the config file, remove the # from:

  • boot.loader.grub.device= "/dev/sda"
  • networking.hostName = "nixos"; < – be sure also to change “nixos” to your preferred hostname.
  • networking.wireless.enable = true <- if you require WiFi.

After making those necessary edits, look through the configuration file and remove # symbols from features and settings you want to enable. Don’t skim through these settings! This configuration file is central to how to install NixOS Linux correctly — it defines your entire system setup before the installer runs.

Note: to save with Nano, do Ctrl + O.

This is how your system will be set up when installed. For guidance on the config file, check the official NixOS manual for detailed documentation on every available option.

After generating a new configuration file, run the nixos-install command to install the operating system. This is the final command you need when following the steps for how to install NixOS Linux from a live disk.

nixos-install

When the terminal is usable again, type reboot to load into your new NixOS system.

reboot

After Install: First Boot and Essential NixOS Configuration

Rebooting into NixOS for the first time is just the beginning. NixOS is built around its configuration file, and understanding what was generated during the install will help you get your system exactly the way you want it.

What nixos-generate-config created

The nixos-generate-config command produced two files in /etc/nixos/:

  • configuration.nix — your main system configuration file. This is where you define your hostname, users, desktop environment, installed packages, services, and more.
  • hardware-configuration.nix — automatically generated from your hardware. It captures detected filesystems, mount points, and kernel modules. You generally don’t edit this file directly.

A minimal starter configuration

Open your configuration file to review and customise it:

sudo nano /etc/nixos/configuration.nix

Here is a minimal example of the key settings most users will want to set early on:

{ config, pkgs, ... }:

{
  networking.hostName = "my-nixos-pc";  # Set your hostname

  time.timeZone = "Europe/London";  # Set your time zone

  i18n.defaultLocale = "en_GB.UTF-8";  # Set your locale

  networking.networkmanager.enable = true;  # Enable NetworkManager for wired and Wi-Fi

  # Add a normal user account (replace "alice" with your username)
  users.users.alice = {
    isNormalUser = true;
    extraGroups = [ "wheel" "networkmanager" ];
  };

  # Example: enable the GNOME desktop environment
  services.xserver.enable = true;
  services.xserver.displayManager.gdm.enable = true;
  services.xserver.desktopManager.gnome.enable = true;

  # Optional: allow proprietary software and drivers (e.g., NVIDIA, Steam)
  nixpkgs.config.allowUnfree = true;
}

Adjust the hostname, time zone, locale, username, and desktop environment to match your preferences. If you need Wi-Fi and aren’t using NetworkManager, you can also enable networking.wireless.enable = true; instead.

Applying your changes

Any time you edit configuration.nix — whether now or in the future — run the following command to rebuild and switch to the updated system:

sudo nixos-rebuild switch

NixOS will download any new packages, apply your changes atomically, and make the new configuration the default at next boot. If something goes wrong, you can always roll back to a previous generation from the boot menu. This is one of NixOS’s most powerful features, and it starts the moment your first boot is complete.

Comments are closed.