Premium course

NixOS 101 Course

From your first NixOS install to your own service modules, remote deployments, and integration tests.

Most people meet NixOS through a configuration.nix they copied from a colleague or a blog post. That works until two modules disagree, an option gets ignored, or the same system has to run somewhere else. This course builds NixOS up from the bottom: what a Nix store is missing to become a bootable system, how the module system turns many files into one configuration, and how that one configuration becomes a laptop, a cloud server, a VM, a container, or a test.

Why this course is different

  • Understand first, automate second. You install NixOS by hand once and see every step, so tools like disko and nixos-anywhere become shortcuts you understand instead of magic you depend on.
  • The module system explained. Options, types, merging, and the REPL tricks that show which file set which value. Afterwards you can read the nixpkgs module sources yourself instead of waiting for a tutorial.
  • nixos-rebuild before extra tools. Learn what the standard tool does under the hood, locally and over SSH, and decide with good reasons whether you need anything else.
  • Taught by a test driver maintainer. The integration test section comes from one of the maintainers of the NixOS test driver, whose team also upstreamed its container support.
  • Patterns and anti-patterns from real organizations. We train hundreds of developers per year and have seen which module designs stay composable and which ones turn a project rigid. You learn the rules before you need them.
  • Human-made, start to finish. Every lesson is recorded by a human who works through real code on a real computer, set up like yours, and explains it in their own voice. No synthetic voices, no avatars. We use AI for one thing only: generating the transcripts, which we then correct by hand.

What you'll learn

  • How NixOS differs from Ansible-style configuration management and golden images
  • Installing NixOS by hand, and building your own installer ISO
  • Generations, rollbacks, upgrades, and pinning your system with a flake
  • Finding options on search.nixos.org and inspecting a configuration in the Nix REPL
  • The NixOS module system: option declarations, types, merging, and writing your own service modules
  • Running any configuration as a VM in seconds
  • nixos-rebuild under the hood, remote builds and deployments, and nixos-anywhere with disko
  • NixOS containers, declarative and imperative
  • NixOS integration tests with VMs and containers, including interactive debugging

What you'll be able to do afterwards

  • Turn your own software into a NixOS service that others enable with one line
  • Deploy the same configuration to a laptop, a cloud server, a VM, or a container
  • Find out in seconds which module set a value in your configuration
  • Deploy and update remote machines with nothing more than nixos-rebuild and SSH
  • Write integration tests that start several machines and check your services against each other
  • Judge NixOS code no matter who wrote it: a colleague, a blog post, or an AI/LLM

Who this is for

  • Nix users who want to run NixOS on laptops, servers, or appliances
  • Administrators who copy NixOS snippets today and want to understand and write their own
  • Developers who want to ship their software as a NixOS service and test it in realistic setups
  • Teams who consider replacing Ansible, golden images, or hand-maintained servers

Prerequisites

Nix basics: the Nix language, derivations and the Nix store, and some nixpkgs and flakes. Our Nix 101 Course covers all of it. You should also be comfortable in a Linux shell, know how SSH keys work, and have a very rough idea of systemd and disk partitions. For the exercises, a Linux machine with KVM works best. macOS works too, with a Linux builder.

What's included

Self-paced, hands-on lessons with lifetime access, including every future lesson and improvement, so the course doubles as your reference long after you finish. The first lessons are free to preview: start with Welcome: is this NixOS course for you? and decide for yourself.

Lessons

Browse the videos included in this course.

28 videos

Section 1 — Getting started: install NixOS and live with it

7 lessons

See what makes NixOS different from other distributions, install it by hand from your own installer. Learn the everyday basics: Generations and rollbacks, upgrades, pinning with a flake, and keeping disk usage in check.

1.1 Welcome: is this NixOS course for you? Free preview

This NixOS course takes you from installing NixOS by hand to writing your own service modules, deploying over SSH, and testing whole networks of machines. This first video walks through the topics and the prerequisites, so you can decide whether the…

Sign up free to watch

1.2 How NixOS is different: one configuration instead of steps Free preview

Ansible, Puppet, and golden images all promise well managed servers. NixOS takes a different route with its declarative style. This lesson explains how this style fundamentally differs from the existing tools/frameworks Afterwards you can explain…

Sign up free to watch

1.3 Build your own custom NixOS installer ISO

The stock NixOS installer works, but every installation starts with typing your Wifi password and fetching your tools again. In this lesson you build your own installer ISO from a small flake, with your editor, your Wi-Fi, and your SSH key already…

Locked

1.4 Installing NixOS by hand: partition, format, mount, install

Graphical installers hide the steps you later want to automate. This lesson installs NixOS in a VM the manual way, following the official NixOS manual: Partitioning, formatting, mounting, generating a configuration, and running nixos-install. Do it…

Locked

1.5 Install a desktop and roll back NixOS generations

Your fresh NixOS system boots into a bare console. In this lesson you add a desktop environment with a few lines of configuration, try a second one, and switch between them from the boot menu. It is the quickest way to feel what NixOS generations…

Locked

1.6 Upgrading NixOS and pinning your system with a flake

Where does the pkgs in your configuration.nix actually come from, and how do you update it? This lesson upgrades a NixOS system the classic way with channels, then turns the configuration into a flake, so the exact nixpkgs version lives in a lock…

Locked

1.7 Reclaim disk space from old NixOS generations

You ran nix-collect-garbage -d, and NixOS still uses 11 gigabytes. This short lesson shows what keeps old packages alive on a NixOS system, and the one bootloader setting that cuts disk usage roughly in half.

Locked

Section 2 — NixOS configuration and the module system

5 lessons

Find any option, read any configuration, and understand the module system behind it: option declarations, types, merging, and how to ask your configuration which file set a value.

2.1 Reading NixOS configurations and finding options on search.nixos.org

Where do attribute paths like services.openssh.enable come from, and how do you find the ones you need? This lesson takes apart a typical configuration.nix, searches options on search.nixos.org, and follows them into the nixpkgs source that defines…

Locked

2.2 Anatomy of a NixOS module: declaring options

Using options is one half of NixOS. Declaring your own is the other half, and it is how services.myservice.enable = true gets to exist. This lesson shows the two parts of a module that declares options, the fields every option has, and the helpers…

Locked

2.3 Exploring the NixOS module system in the REPL

You don't need a full NixOS system to learn how modules work. In this lesson we evaluate modules on their own with lib.evalModules in the Nix REPL, declare options from scratch, and watch the module system check, merge, and trace them.

Locked

2.4 How NixOS merges options by type

Two modules set the same option. Is that an error, does one of them win, or are the values merged? This lesson answers the question with a small quiz and a hands-on example, and shows how option types decide what happens.

Locked

2.5 Who set this? Inspecting a live NixOS configuration in the REPL

In a large NixOS configuration spread over many files it can happen values show up that you never set yourself. This lesson loads a real NixOS flake into the Nix REPL, browses the evaluated configuration, and traces values back to the module that…

Locked

Section 3 — Your own NixOS service modules

4 lessons

Turn a program into a NixOS service, run it in a VM in seconds, extend it in a hands-on exercise, and learn the rules that keep modules composable as projects grow.

3.1 Write your first NixOS service module

Turn a program into a service that anyone can enable with one line. This lesson walks through a minimal module that declares services.hello.enable and a port option, wires them to a systemd service, and deploys it on a running NixOS system.

Locked

3.2 Run your NixOS configuration as a VM

Developing modules on the machine you work on is risky. This lesson builds a NixOS configuration into a VM with one command, using the Hello as a Service module from the previous lesson, and reaches it from the host via port forwarding and SSH.

Locked

3.3 Exercise: add an openFirewall option to your service module

Practice time with two tasks: First you open the generated VM script and work out why rebuilding a whole NixOS VM takes only seconds. Then you add an openFirewall option to the Hello as a Service module, just like many nixpkgs services offer, using…

Locked

3.4 NixOS module rules: keep your configurations composable

This lesson recaps how a NixOS system is evaluated and built. Then, we define a set of rules for module authors. These come from training hundreds of people and seeing which shortcuts hurt later.

Locked

Section 4 — Building and deploying NixOS systems

3 lessons

Learn what nixos-rebuild really does, use it for remote builds and deployments over SSH, and put NixOS on a cloud server that never ran it before.

4.1 How nixos-rebuild works under the hood

nixos-rebuild is the deployment tool you already have. It does less magic than it seems. This lesson builds a system with and without flakes, takes the result apart, and shows the few steps behind switch, boot, and test. Knowing them helps you judge…

Locked

4.2 Remote builds and deployments with nixos-rebuild

Your laptop does not have to build or run the system it deploys. This lesson shows how --build-host and --target-host combine into every common deployment scenario, what gets copied where during a remote deployment, and how to keep slow connections…

Locked

4.3 Install NixOS on a cloud server with nixos-anywhere and disko

Your cloud provider offers Ubuntu, but no NixOS. In this lesson we take over a fresh Hetzner VM with nixos-anywhere, declare its disk layout with disko, and then keep developing the server with plain nixos-rebuild --target-host.

Locked

Section 5 — NixOS containers

2 lessons

Run NixOS services in lightweight systemd-nspawn containers, declared in your system configuration or managed by hand, even on other Linux distributions.

5.1 Declarative NixOS containers

Wrap a piece of your NixOS configuration in a few extra lines, and it runs in its own lightweight container. This short lesson moves the Hello as a Service module from the host into a declarative NixOS container and shows how to look inside.

Locked

5.2 Imperative NixOS containers with nixos-container

Not every host runs NixOS, and not every container change should need a full system rebuild. This lesson creates, starts, and enters a NixOS container with the nixos-container tool, which also works on Ubuntu and other distributions.

Locked

Section 6 — NixOS integration tests

7 lessons

Spin up several machines as VMs or containers, script what they do in Python, debug failures interactively, and write a test for your own service.

6.1 NixOS integration tests: what the test driver can do

NixOS integration tests start several machines, connect them in virtual networks, and check that your services work together just like in production. This lesson shows what the more than a thousand tests in nixpkgs do, the anatomy of a test, and why…

Locked

6.2 Your first NixOS integration test

Two machines that ping each other: the smallest useful NixOS integration test. In this lesson you run it with runNixOSTest, read its output, change it, and then switch the machines from VMs to containers and watch the runtime drop.

Locked

6.3 NixOS test driver features: modules, linting, and machine methods

A tour of the test driver features you will use in real projects, and of where to look up the rest. This lesson covers how tests compose like modules, the checks that run over your test script, extra Python packages, and the methods available on…

Locked

6.4 Faster NixOS tests with systemd-nspawn containers

NixOS tests can run their machines as lightweight systemd-nspawn containers instead of VMs, a feature our team built and upstreamed into nixpkgs. This lesson compares both, shows when containers are the better choice, and explains the Nix daemon…

Locked

6.5 Debugging NixOS tests interactively

A test that fails after an hour should not cost you another hour for every fix attempt. This lesson shows the interactive mode of the NixOS test driver: start machines from a Python shell, watch the test run, and log into the machines while they run.

Locked

6.6 Exercise: write an integration test for your NixOS service

Practice time. You write a test for the Hello as a Service module from earlier in the course: one machine runs the service, and a client fetches its output over the network. Then we polish the test until it is free of race conditions and hard-coded…

Locked

6.7 Where to go next with the NixOS test driver

The test driver has more features than a video course can cover without turning into an encyclopedia. This closing lesson shows where to continue on your own: the NixOS manual chapter on tests, the NixOS test driver manual with runnable examples and…

Locked
Sign in

Signing up is free — no credit card needed.

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

“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
“Nix is a very promising technology, but I found it very difficult to get started. The Nixcademy helped me a lot to use Nix effectively in my work. The training has given me the practical skills I need to fully evaluate and use Nix.”
Christian Haar
Christian Haar
Audio/DSP Software-Engineer · Kemper
“Nixcademy has been a game-changer for me. Working with my mentor has been incredibly rewarding. The personalized guidance and in-depth education have boosted my skills tremendously. I highly recommend Nixcademy for anyone serious about mastering Nix.”
Chris O'Brien
Chris O'Brien
Software Developer · Versatus