Skip to content

document pinning nixpkgs pin for NixOS by npins from system.nix#1232

Open
KiaraGrouwstra wants to merge 2 commits into
NixOS:masterfrom
KiaraGrouwstra:npins-system-nix
Open

document pinning nixpkgs pin for NixOS by npins from system.nix#1232
KiaraGrouwstra wants to merge 2 commits into
NixOS:masterfrom
KiaraGrouwstra:npins-system-nix

Conversation

@KiaraGrouwstra

Copy link
Copy Markdown
Contributor

now that 26.05 is finally stable, i guess we can now document using npins with nixos on here now 😶

@KiaraGrouwstra KiaraGrouwstra requested a review from infinisil as a code owner June 1, 2026 19:40
NixOS relies on the `NIX_PATH` environment variable to locate `nixpkgs`, which defaults to using channels.
To instead use a `nixpkgs` version managed by `npins`, one can manually override this environment variable on system rebuilds:
NixOS defaults to using channels to locate `nixpkgs`.
You can instead pin a version using `npins` from the `system.nix` entrypoint:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes it sound like "the system.nix entry point" is some sort of first-class concept.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its release notes entry mentions one could straight-up have their entire config in there, i.e. have a working system for the purpose of those nixos-rebuild / nixos-install without use of any other files.
that makes me wonder: what do you mean here when you'd consider it not first-class?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware of that change, but now that you remind me, I remember seeing some discussion around it when it was still in the works.

In that case, how about linking to the NixOS (or more precisely, nixos-rebuild and nixos-install) reference documentation on the subject? Otherwise the initial impression of "you have to know to know" still holds.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per the release notes, its use-case that needs passing some extra thing is when it's used as an attrset of nixos configurations, in which case the commands need to know which one to use.
that feature isn't invoked in the example here, and i've been able to use the system.nix entrypoint myself without really having needed to be aware of how it can be used: as far as on-par functionality goes, it 'just works'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants