NixOS · a Linux distribution built from configuration

A system you can put back together.

You spend time getting a computer right. The tools, the services, the small settings you would rather not rediscover after a reinstall.

NixOS lets you describe that setup in files and build your Linux system from them. Keep the configuration. Change it deliberately. Bring it to the next machine.

§ 01Generations

Make a change you can explain.

Add a package to your configuration. Build a new system generation. Keep the previous one available while you try the change.

The useful part is being able to see what you asked the machine to become.

Interactive illustrationNothing runs on your computer
configuration.nix
{ pkgs, ... }: {
  programs.firefox.enable = true;
  programs.git.enable = true;
}
System generations
  1. AFirefox · GitCurrent

Generation A is current. Firefox and Git are enabled through their modules.

Simplified. A previous generation can only be used while it is still retained; garbage collection can remove it.

Rollback changes system software and managed configuration. It does not rewind your documents or database contents.

§ 02Where it fits

Start with the computer you have in mind.

  1. Desktop

    Your everyday machine

    A laptop or desktop with familiar applications and a configuration you keep improving.

    NixOS on the desktop
  2. Server

    A machine that runs services

    A homelab, a small server or a handful of hosts. Share the common parts; keep the differences explicit.

    NixOS for servers
  3. Device

    A device with one job

    Build a VM or installation image around the software it needs. Check the hardware before buying a board.

    Devices and images
§ 03Forum

What people are reading.

Questions, announcements and long design threads from the official NixOS forum. Top topics this week.

From NixOS DiscourseWeekly top · refreshed every 30 min
  1. 01Challenges working in defenseUncategorized36 replies
  2. 02What if every Nix build were bit-reproducible?Links15 replies
  3. 03Announcing NH 4.5.0Announcements2 replies
  4. 04CoC proposal: prohibit job shamingMeta27 replies
  5. 05From argument patterns to pattern matchingNix14 replies
§ 04Tools

Names you will run into.

A few of the projects that come up in almost every NixOS thread. The tools page groups two dozen of them by job and says who maintains each.

  • Home ManagerManages dotfiles, user packages and per-program settings with the same module system NixOS uses.
  • diskoDeclares partitions, filesystems, LUKS and RAID layouts in Nix and can apply them during installation.
  • sops-nixDecrypts secrets managed with sops (age, GPG or cloud KMS) during activation, so the encrypted files can live in your configuration repository.
  • devenvProject environments in a devenv.nix file: languages, services such as PostgreSQL, and long-running processes, built on Nix.
  • nixos-anywhereInstalls NixOS over SSH onto a machine running another Linux, using kexec and disko to partition the disks.
  • nixdA language server that evaluates Nix code to offer completion and option documentation, including NixOS and Home Manager options.
All tools, grouped by job
Nix

You can start smaller than an operating system.

Nix is the package manager behind NixOS. You can also use it on an existing Linux or macOS installation: try a tool, describe a project’s development environment, or bring the same build definition into CI.

finix

There is room to try another approach.

finix explores a different Nix-based operating system, with finit in place of systemd. It is an experimental project for people who want to work on those questions, not a shortcut around learning NixOS.

Community

People belong in the picture.

This site welcomes queer and trans people, newcomers, and the people doing the unglamorous work of keeping free software useful. Pride stays visible here throughout the year.