Premium course

Nix 101 Course

Nix 101: From Zero to Fluent

⚠️ Work in progress. This course is still being recorded and published — new lessons are added regularly. By buying now you get lifetime access and every lesson as it lands, at the early price.

From your first shell to writing production derivations — without cargo-culting.

Most Nix tutorials hand you a flake and hope. This one builds your mental model from the ground up, so that by the end new Nix errors stop being scary, new Nix tools feel familiar, and you can read and write real-world Nix with confidence.

Why this course is different

  • Bottom-up, not copy-paste. We teach the sandbox, the derivation, the hash, and the store in that order — so the magic turns into mechanics you can reason about.
  • Honest about trade-offs. Flakes get real coverage, including when not to use them. Docker, Homebrew, apt, and venv/uv get a fair comparison so you know exactly where Nix fits.
  • Hands-on throughout. You'll write sum and takeN, package GNU hello with patches you wrote yourself, and build a release.nix with static, patched, and clang-built variants.

What you'll learn

  • Nix as a daily-driver package manager and dev-shell tool
  • The Nix language — syntax, evaluation model, lazy evaluation, and the idioms you'll actually meet
  • How a build really works: sandbox → derivation → hash → store
  • Reproducible dev shells with nix-shell and nix develop, wired into direnv
  • Writing derivations from builtins.derivation up to stdenv.mkDerivation
  • Composing nixpkgs with callPackage, override, overrideAttrs, and overlays
  • Flakes — honest coverage, plus the npins/niv alternatives
  • Debugging Nix: reading evaluation errors, tracing expressions, diagnosing build failures

What you'll be able to do afterwards

  • Ship a reproducible dev environment your whole team uses from day one
  • Package a piece of software and contribute a fix back to nixpkgs
  • Debug a Nix error calmly — without panic or StackOverflow roulette
  • Move confidently into any advanced course (NixOS, Nix on Mac, ML/CUDA) without re-learning the basics

Who this is for

Developers curious about Nix who bounced off the scattered docs the first time, teams evaluating it for reproducible environments, and current users who copy-paste expressions and want to actually understand them.

No prior Nix — and no functional-programming background — required. Everything works on macOS and Linux.

Prerequisites

Comfort in a Unix shell (bash or zsh), basic programming experience in any language, and a machine where you can install software (we cover installation in the very first lesson).

What's included

Self-paced, hands-on lessons with lifetime access, so the course doubles as your reference long after you finish. Several lessons are free to preview — start with The problem Nix actually solves before you decide.

Lessons

Browse the videos included in this course.

37 videos

Section 1 — Getting started: install Nix and score your first wins

5 lessons

Get Nix installed cleanly and feel the payoff within minutes — run any tool without installing it, keep the ones you want, reclaim disk space, and set up an editor that makes everything that follows go faster.

1.1 Installing Nix the right way

Get Nix onto your machine correctly the first time. We compare the upstream and Determinate Systems installers, explain single-user versus multi-user setups, and show how to uninstall cleanly — so you can start experimenting knowing you can always back out without leaving a mess.

Sign in to unlock

1.2 Your first commands: nix run & nix shell

Your first taste of the Nix superpower: run any of 100,000+ packages without installing them. With nix run and nix shell you reach for a tool, use it, and let it vanish — no global clutter, no version conflicts, nothing to clean up afterwards.

Sign in to unlock

1.3 Installing tools to keep with nix profile

When you do want a tool to stick around, nix profile is how. Learn to install, list, upgrade, and roll back the packages in your user profile — package management that never strands you on a broken upgrade, because the previous generation is always one command away.

Sign in to unlock

1.4 Garbage collection on day one

Nix keeps every version it has ever built — a feature, right up until your disk fills up. Learn the single command that safely reclaims that space on day one, so storage never becomes the reason you stop exploring. (We return to how garbage collection decides what's safe later in the course.)

Sign in to unlock

1.5 Set up your editor before going further

Spend ten minutes here and the next two hours of language learning go three times faster. We set up nixfmt for formatting and nixd as your language server — autocomplete, jump-to-definition, and inline errors — in VS Code, Neovim, Emacs, or JetBrains. The viewers who skip this step always come back to it, usually after some avoidable frustration.

Sign in to unlock

Section 2 — The Nix language

10 lessons

Every Nix file you'll ever read or write is in this language. Learn it once — syntax, evaluation model, lazy evaluation, and the everyday idioms — and the rest of the Nix world stops feeling like a foreign alphabet. Includes two hands-on exercises that make the syntax stick.

2.1 Why a config language has functions

Think of Nix as "JSON with functions". In a couple of minutes you'll see why a real language beats static templates for configuration — and why that single design decision is what makes everything else in Nix possible. The natural answer to "why not just YAML?"

Sign in to unlock

2.2 The REPL as a power tool

Meet the Nix REPL — the fastest way to learn the language and a genuine power tool. Watch it patch the hello program live to print a custom greeting, reload with :r, and drop you straight into a shell running the patched build. Three Nix superpowers — overrides, the REPL, and the store — on screen at once, plus the colon-commands (:b, :p, :doc) that make the REPL your daily workbench.

Sign in to unlock

2.3 Nix syntax: the complete tour

The complete tour of Nix syntax in one focused sitting: strings and indented strings (with the tricky ${} escapes), numbers, lists, attribute sets and inherit, functions and currying, let/with scoping and their pitfalls, import, and how to merge sets with // versus lib.recursiveUpdate. After this, nixpkgs source stops looking like a foreign alphabet and becomes something you can actually read.

Sign in to unlock

2.4 Debugging and tracing 101

Every language needs a way to ask "what is this value, really?" Learn builtins.trace, builtins.toJSON, and how to read a Nix stack trace without flinching — plus why there's no step debugger in Nix, and why you won't actually miss it.

Sign in to unlock

2.5 Lazy evaluation, in practice

This is the video that explains 90% of "huh, why didn't that fail?" moments. Through the famous 1/0 puzzle and weak head normal form, you'll finally get lazy evaluation — what it buys you for performance and debugging, and why Nix only ever computes what it truly needs.

Sign in to unlock

2.6 Lists and recursion

The building blocks for everything that follows: head, tail, length, and writing your own recursive functions. We also explain why the syntax is the way it is — so it sticks in your head instead of feeling arbitrary — and set you up for your first hands-on exercises.

Sign in to unlock

2.7 Exercise: write sum

Hands-on: write a function that takes a list of numbers and returns their sum, using head, tail, and length. Ten minutes of real practice that stops you fighting the syntax for the rest of the course.

Sign in to unlock

2.8 Exercise: write takeN

Hands-on: write takeN, a function that returns the first N elements of a list. Together with the sum exercise, this is what turns "I've seen the syntax" into "I can write it" — and it pays off for the rest of the week.

Sign in to unlock

2.9 Common idioms: map, filter, foldl' and friends

The functions you'll reach for every single day: map, filter, foldl', listToAttrs, mapAttrs — and exactly where they live in builtins versus pkgs.lib. A single guided tour through lib/lists.nix (plus noogle.dev for finding the rest) saves more hours than the whole rest of this section combined.

Sign in to unlock

2.10 Importing nixpkgs, properly

How to bring in nixpkgs the right way: import <nixpkgs> { } versus pinning a specific commit for true reproducibility, plus config.allowUnfree and permittedInsecurePackages for the real-world cases the quick tutorials quietly skip.

Sign in to unlock

Section 3 — Dev shells: the productivity unlock

6 lessons

This is the section that converts skeptics. By the end, your repos have a per-directory environment that activates automatically — the exact compiler, language version, and CLI tools your project needs, all without polluting your home directory.

3.1 Why dev shells?

What's wrong with installing toolchains system-wide — and why Docker's sealed box fights you the moment you want to develop inside it. The case for per-project environments that are reproducible, disposable, and identical for everyone on the team.

Sign in to unlock

3.2 Your first dev shell with nix-shell

The quickest concrete win in Nix: a few lines of shell.nix, and your project has exactly the compilers, interpreters, and CLI tools it needs — on every machine, without installing anything globally. If one video sells you on dev shells, it's this one.

Sign in to unlock

3.3 Deriving the shell from the package

Your package definition already knows its build dependencies — so stop repeating them. Learn how to derive the dev shell directly from the package, so the environment you develop in is guaranteed to match the environment you build in.

Sign in to unlock

3.4 An extended dev shell, without duplication

Developers want more than the build needs: formatters, linters, debuggers, language servers. Learn how to layer these extras on top of the package's own dependencies — one source of truth, no duplicated lists to drift out of sync.

Sign in to unlock

3.5 nix develop and flake-based shells

The modern, flake-based counterpart to nix-shell: how nix develop works, what a devShell output looks like, and honest guidance on when to reach for which of the two worlds.

Sign in to unlock

3.6 direnv integration

Automatic per-directory environment activation: cd into the project and the right tools are simply there — leave, and they're gone. This is the feature that converts skeptics for real.

Sign in to unlock

Section 4 — How Nix actually builds: sandbox → derivation → hash → store

6 lessons

Every weird Nix error and every "why is it rebuilding the world?" question traces back to three things — the sandbox, the .drv, and the hash. Forty focused minutes here, and the rest of the course stops feeling like incantations. This is the section that turns Nix from magic into mechanics.

4.1 What actually happens when you run nix build

A three-minute live build of hello: watch the sandbox get set up, the builder run, and the output land in the store. Along the way we separate evaluation from realisation — .nix.drv/nix/store/... — and plant the questions the rest of this section answers.

Sign in to unlock

4.2 The sandbox, demonstrated

A tiny derivation tries to curl the internet, read /etc/passwd, and use tools it never declared as inputs — and every single attempt fails. This is the mechanism that makes "works on my machine" structurally impossible.

Sign in to unlock

4.3 The derivation is just a recipe

We run nix derivation show on a derivation written by hand with builtins.derivation and find… no magic at all: a list of store paths to provide, environment variables, a builder, and args — mapping 1:1 onto the execve(2) system call. Every Nix abstraction you'll meet later is sugar on top of this.

Sign in to unlock

4.4 Exercise: package mini-hello with builtins.derivation

Hands-on: write a builder shell script, fill $out, declare coreutils, gcc, and gnumake as inputs, inspect the resulting .drv, and install your creation with nix profile install. This is the exercise that crystallises everything you just watched.

Sign in to unlock

4.5 The store as the consequence

Walk through a real /nix/store/<hash>-<name> path and trace its dependencies with nix-store --query --tree. Runtime versus build-time dependencies, and the neat trick behind it all: Nix scans output binaries for store-path references to detect what a program truly needs at runtime.

Sign in to unlock

4.6 Avoiding unnecessary rebuilds

Our minimal mini-hello recipe has a flaw: it rebuilds even when nothing meaningful changed. We dig into why that is and fix it — a first taste of how Nix decides what needs rebuilding and how to keep your builds cached.

Sign in to unlock

Section 5 — Packaging real software with stdenv.mkDerivation

10 lessons

Once you can write a mkDerivation, you can package literally anything: your company's internal tools, that one obscure CLI nobody has upstreamed, even your own scripts. By the end of this section you'll have packaged GNU hello end to end with patches you wrote yourself — and everything else in the Nix universe (buildPythonPackage, buildGoModule, buildRustPackage, crane) will read as sugar on top of what you just learned.

5.1 The typical software-build dance

wget, tar, ./configure, make, make check, make install — the ritual every Unix project has followed for decades. The GNU project structured it into phases long before Nix existed, and that structure is exactly what stdenv.mkDerivation automates. Recognise the dance and mkDerivation stops looking like something you have to memorise.

Sign in to unlock

5.2 A minimal stdenv.mkDerivation

Build GNU hello in three lines. You supply name and src, the default phases do the rest — this is the moment packaging turns from writing a builder script by hand into declaring what you have and letting stdenv drive.

Sign in to unlock

5.3 What stdenv ships with

Bash, a C compiler, coreutils, patch, make, the whole GNU toolchain — the batteries in mkDerivation's batteries-included. We take inventory of what you get for free, then declare everything else with buildInputs and its siblings.

Sign in to unlock

5.4 The build phases

unpack, patch, configure, build, check, install, fixup: each one a hook with a sensible default, each one yours to override or extend with pre* and post*. Plus the escape hatches — dontUnpack, dontBuild, doCheck — for the projects that refuse to follow the script.

Sign in to unlock

5.5 Exercise: extend GNU hello

Hands-on: write configurePhase, buildPhase, checkPhase, and installPhase yourself, then add a patches = [ ./… ]; entry that changes the greeting. By the end you've packaged a real GNU project from source — with a patch you wrote.

Sign in to unlock

5.6 Debugging failing builds

Builds fail — learn to fix them without frustration. nix-build --keep-failed to inspect the wreckage, NIX_DEBUG when you need more detail, and pkgs.breakpointHook (Linux only) to drop into an interactive shell inside the failed build. Plus a taxonomy of the common errors and the first thing to check for each.

Sign in to unlock

5.7 Pinning: making nixpkgs mean the same thing everywhere

import <nixpkgs> { } means something different on every computer — and that quietly undoes the reproducibility you came for. Learn to pin your code without flakes, and pick up how downloading pinned content works in Nix generally along the way.

Sign in to unlock

5.8 Fetching code and the fixed-output derivation

fetchurl, fetchzip, fetchpatch, fetchgit, fetchFromGitHub — and the question everyone asks eventually: why does the hash appear twice? Meet the fixed-output derivation, plus TOFU versus computing the hash up front with nix hash file or nix-prefetch-git.

Sign in to unlock

5.9 Language-specific builders

A quick tour of buildPythonPackage, buildGoModule, and buildRustPackage with vendorHash/cargoLock, plus crane for Rust. You don't need to memorise any of them — the point is that once mkDerivation has clicked, you can read all of them.

Sign in to unlock

5.10 Build helpers everyone uses

runCommand for one-off transformations, symlinkJoin for assembling $PATH-style directories, and writeShellApplication for shipping team scripts with shellcheck running at build time — the most rock-solid way to distribute a shell script you'll ever use.

Sign in to unlock

Instant access

Start watching the moment your purchase completes.

Lifetime access

Buy once and revisit every lesson whenever you need it.

Secure checkout

Payments handled by Paddle, our trusted reseller.

Jacek Galowicz

Taught by Nixcademy

The same material we teach in our professional, instructor-led Nix and NixOS classes — built from real training experience helping engineers and teams adopt Nix in production.

Nixcademy

What learners say

“Jacek's technical expertise and dynamic teaching style have been a game-changer for my team as we navigate the fast-paced world of AI and mobile app development. His exceptional support has been an incredible asset, and I cannot imagine going back to our previous ways of working without him.”
Matthias Raaz
Matthias Raaz
CEO · Deep5 GmbH
“I am delighted with the course and the content! The tutor is competent and presents the content in an understandable way and responds to spontaneous questions in detail. The many practical examples have opened up new ideas and horizons for me. The training week was full of aha-effects.”
Jürgen Lorff
Jürgen Lorff
Software Developer · ESG
“Jacek's invaluable support and expertise were instrumental in enabling my team to develop customized systems for sensor data collection. His adept use of Nix for ensuring maintainability and quick deployments has been nothing short of remarkable. My employees have consistently praised his exceptional teaching style.”
René Renger
René Renger
CEO · Novus GmbH