How do I update a single package installed with a standard config file?

A channel is all-or-nothing. A version of a channel corresponds to a particular Git commit of Nixpkgs; when you update your channels, you’re fetching the latest such commit. Then every package in your configuration, which uses your system channel as its source of packages by default, will be updated.

So in order to update only a single program, you want to get the definition of the package from an alternate source, not your system channel. That’s what this comment is showing you how to do. Then don’t update your channels; just rebuild your system configuration. Nix will pull down a second copy of Nixpkgs into your store corresponding to the pinned commit, and any packages you reference from that source will have the versions they have in that commit.

4 Likes