Can I pin package versions with niv on home-manager?

Looks like package versions are managed by nix-channel, and there seems no way to pin it for reproducibility on other machines.
I’m still new to nix/home-manager and don’t know how home.nix configuration works. Is there a way to pin package versions with niv, or does something else work?

1 Like

Yes, it is possible.

The idea is that you use niv to pin your inputs and then wrap running home-manager in a small script that loads a nix-shell first, that sets the NIX_PATH variable to the pinned versions.

An example of this can be seen in this repository by @ryantm:

6 Likes