How NixOS Works
Declarative Linux, Configured with Flakes
Most Linux systems are shaped by years of accumulated commands — a package installed here, a config file edited there, a service enabled and half-forgotten. NixOS takes the opposite approach: the entire system is described by a set of files, and a single command makes reality match that description. The result is declarative, reproducible, atomic, and rollbackable — if an upgrade breaks your machine, you reboot into the previous version from the boot menu.
This series is flakes-first. Flakes are the modern way to pin a NixOS configuration's inputs so it builds the same way on any machine, at any time. They're still technically an "experimental" feature of Nix, but they've become the de-facto standard for new configurations — so that's where we start and stay.
Getting Started
The mental model, the Nix language, and your first flake-based config.
-
001
Intermediate The NixOS Mental Model
Why a whole Linux system can be a single, rebuildable description
- 002
-
003
Intermediate Your First Flake-Based Configuration
Build a real, minimal NixOS system from two small files
- 004
-
005
Intermediate Generations, the Store & Rollbacks
The commands and symlinks behind atomic upgrades and one-reboot recovery
-
006
Intermediate Managing Your User with Home Manager
Bring the same declarative, rollbackable discipline to your dotfiles, shell, and user packages
Going Deeper
Advanced configuration and packaging.
-
007
Advanced Exploring nixpkgs with the REPL
Turn nixpkgs from an opaque monolith into something you can poke at, one expression at a time
- 008
-
009
Advanced Writing Your Own Derivations
From the builtins.derivation primitive up to stdenv.mkDerivation and the language builders
-
010
Advanced Packaging Software That Isn't in Nixpkgs
Write a local package and wire it into your NixOS configuration
-
011
Advanced Reproducible Dev Environments
Pin a project's exact toolchain in its flake — and enter it automatically
-
012
Advanced Handling Secrets with SOPS
Keep passwords, keys, and tokens out of the world-readable Nix store
Troubleshooting & Tips
Debugging builds and flake gotchas.
-
013
Advanced Troubleshooting & Debugging
A systematic way to read Nix errors, tell eval failures from build failures, and reach for the right tool
- 014