Understanding the core problem Nix solves
You've probably experienced this:
pip install or npm install, you're modifying the global state of your machine in ways that are hard to reproduce elsewhere.
Nix asks a radical question: What if all software dependencies and configurations were treated like code? Not just stored in version control, but genuinely reproducible, testable, and composable.
The difference between traditional package managers and Nix is fundamental:
You tell the system HOW to install things:
Problems:
• Global state (what version exists depends on when you ran the command)
• Hard to replicate (colleague runs same commands, gets different versions)
• No easy rollback
• "Works on my machine" syndrome
You describe WHAT you want, Nix figures out HOW:
Benefits:
• Locked versions (exact versions in flake.lock)
• Reproducible everywhere
• Easy rollback (commit history)
• Same config = same setup
Three key ideas work together:
Every package in Nix is defined as a pure function: same inputs → same output, no side effects. This is the foundation of reproducibility.
All packages are stored in /nix/store with names based on their content hash. If two builds produce the same result, they're deduplicated. If something changes, the hash changes.
Builds are isolated—they can't accidentally depend on global system state. They only see explicitly declared inputs.
For the use case you mentioned (system configuration & reproducibility):
nix flake show and your whole team has the exact same setupWe're building toward reproducible, shareable development environments. Here's the arc:
Let's verify that Nix is installed on your system and get a feel for how it works.
You should see something like nix (Nix) 2.18.1
This searches the nixpkgs repository for a package called "hello"
This downloads and runs the "hello" package in an isolated environment. Notice: no global installation, no ~/.local/bin/ pollution.
✨ You just used Nix! You ran a package without installing it globally. It's isolated, reproducible, and ephemeral.
Take a moment to think about these questions (no need to answer—just reflect):
nix run compared to installing with a package manager?Once you've completed the experiment above, you're ready for Lesson 2, where we'll write your first Nix expression and understand the language syntax.