Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How NixOS Changes Linux Configuration, Updates and Development

NixOS describes system settings in code and keeps generations for rollback. Understand the benefits, learning curve and limits of reproducibility and recovery.

Table of Contents

NixOS manages much of a Linux system through a declared configuration rather than a history of manual package installations and edits. Rebuilding that configuration creates a system generation that you can activate or roll back. The approach can make changes easier to track, but it introduces a new language and does not replace backups of documents or application data.

Describe the desired system in configuration

Why will the NixOS experience completely change the way you view Linux? Picture 1

On a conventional installation, installed packages and edited settings can gradually drift from your notes. NixOS lets you declare system packages, services and other options in configuration files, commonly starting with /etc/nixos/configuration.nix.

For example, in an existing module that has access to pkgs, a system package list can include Git:

environment.systemPackages = with pkgs; [
  git
];

Add packages to your existing list rather than replacing the rest of the configuration with this fragment. NixOS modules provide options for supported services, reducing the need to edit generated files manually.

Keeping configuration in version control makes it easier to see what changed and reuse appropriate settings. Hardware-specific configuration, secrets and package-source versions still need deliberate handling when moving to another machine.

Rebuild deliberately instead of patching generated files

Why will the NixOS experience completely change the way you view Linux? Picture 2

Why will the NixOS experience completely change the way you view Linux? Picture 3

Why will the NixOS experience completely change the way you view Linux? Picture 4

Why will the NixOS experience completely change the way you view Linux? Picture 5

Why will the NixOS experience completely change the way you view Linux? Picture 6

The Nix language is a configuration and expression language, not a replacement name for Bash. Familiar Linux shell commands remain useful, but distribution-specific package and service instructions may need translation into NixOS options.

For a standard configuration setup, these commands serve different purposes:

CommandPurpose
nixos-rebuild buildBuild without activating the new system.
sudo nixos-rebuild testActivate for testing without making it the default at boot.
sudo nixos-rebuild switchActivate and make the generation the boot default.
sudo nixos-rebuild bootSet the next boot configuration without activating it now.

A flake-based or otherwise customized setup may require additional arguments. Follow the NixOS manual for your configuration method. Building successfully checks part of the setup; it does not prove that networking, graphics or every application will behave correctly.

Generations make recovery easier, within limits

Why will the NixOS experience completely change the way you view Linux? Picture 7

A generation records a system configuration and the packages it references. If a new configuration causes trouble, an older retained generation can be selected from the boot menu. To return to the previous system generation from a running system, the usual command is:

sudo nixos-rebuild switch --rollback

This is not a full filesystem snapshot. Documents, database contents and other mutable data are not automatically restored to their earlier state. A service upgrade may change a database format that an older service cannot read. Bootloader damage, storage failure and deleted generations also require different recovery methods.

Keep backups and a known-working generation. Garbage collection can remove old generations and their store paths, so retention choices affect what you can recover. The How Nix Works guide explains the separation between system configuration and mutable state.

Project shells make tools available without global installation

Why will the NixOS experience completely change the way you view Linux? Picture 8

Nix development environments let a project specify tools and dependencies. A shell created with nix-shell, or nix develop for a suitable flake, can expose those tools without adding them to the system-wide package list.

Leaving the shell changes which tools are available through that environment; it does not instantly delete downloaded packages from disk. They remain in the Nix store until eligible for garbage collection. A development shell also is not a security container: programs can still access resources allowed by your user account.

Flakes provide a structured way to describe inputs and outputs, with a lock file for input revisions. They remain an experimental Nix feature, and reproducibility depends on controlling the relevant inputs. Binary caches can avoid local builds when matching prebuilt outputs are available.

Who benefits most from the change?

NixOS is appealing when you want reviewable system changes, several similarly configured machines or explicit development dependencies. It is less convenient when you mainly want to follow arbitrary package-installation instructions without adapting them.

Try it in a virtual machine or separate installation first. Configure one application and one service, test a rebuild, and practice choosing a previous generation. That shows the real maintenance workflow more clearly than a promise that the system can never break.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.