Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installing NixOS

This Nix configuration provides its own installation image. Unlike the official NixOS installer, it bundles the Nix configuration and most of its packages.

nixos-rebuild build-image --image-variant iso-installer --flake .#installer-homes

Burn the installation image onto a flash drive.

On the target system, disable Secure Boot and boot the flash drive. You will automatically be logged in and greeted by Gremlin Shell. This desktop environment lets you test the bundled applications before installing NixOS. The Nix configuration is symlinked to /etc/nixos.

Partition the drives with Disko.

Warning

This will erase everything on those drives.

sudo disko --mode destroy,format,mount --flake /etc/nixos#<host>

You will be asked to enter a password for disk encryption.

Install the NixOS configuration.

sudo nixos-install --no-root-password --flake /etc/nixos#<host>

Don’t forget to set up user passwords.

sudo nixos-enter --command "passwd <user>"

Finally, reboot into the newly installed NixOS system.

See also