Package Channels
Every machine has both nixpkgs releases available at the same time: the current unstable channel and the latest stable one. One of them is the default — the release a plain package name resolves to — and the other stays reachable for individual packages.
Cherry-pick a single package
Section titled “Cherry-pick a single package”Put stable. or unstable. in front of a package to take just that one from
the named release. A bare package name comes from the default channel, so you
only need the prefix for the exceptions.
environment.systemPackages = with pkgs; [ stable.rstudio # broken on unstable, see upstream issue];The reverse works too:
environment.systemPackages = with pkgs; [ unstable.claude-code # follow frequent updates];Switch the default channel
Section titled “Switch the default channel”The default is chosen in flake.nix by pointing nixpkgs at one of the two
releases. Change that line to move the whole configuration — every host and
the supporting inputs (disko, sops-nix, and the rest) follow along.
nixpkgs.follows = "nixpkgs-stable"; # was: nixpkgs-unstablenixpkgs-stable.url = "github:NixOS/nixpkgs?ref=nixos-26.05";nixpkgs-unstable.url = "github:NixOS/nixpkgs?ref=nixos-unstable";Home Manager is pinned the same way. Point home-manager at the release
that pairs with your channel:
home-manager.follows = "home-manager-stable"; # was: home-manager-unstablehome-manager-stable.url = "github:nix-community/home-manager?ref=release-26.05";home-manager-unstable.url = "github:nix-community/home-manager";Then refresh the lock file and rebuild:
nix flake locknixos-rebuild switch --sudo --flake