How to pin nix registry nixpkgs to release channel

I personally don’t like the global registry, with its imperative way of management.
Instead I remove the global registry and declaratively setup the user registry.

To remove the global registry, set the flake-registry option in nix.conf to an empty registry:

(an empty registry looks like: { "version": 2, "flakes": [] })

To configure the user registry, it is stored in ~/.config/nix/registry.json and I configure it with a home manager module of my own:

And I use it like this:

To declare a pkgs flake (pinned to the nixpkgs of my home flake) and an unstable user flake (on the github’s nixpkgs-unstable branch)

Hope it helps someone :slight_smile:

4 Likes