infinisil/sanix

Find and Pin to Specific Commit of nixpkgs

Opened this issue · 2 comments

Thank you for creating this repo! Will you kindly update the readme to 1) include how you find the current commit of nixpkgs, and 2) how to set the specific commit on a second machine?

Let me know how I can sponsor your work.

Here is the scenario I believe I want to accomplish:

  • Keep a production server up to date.
  • Ensure a UAT server is at the exact same nixpkgs commit as production to ensure proper testing.

Checking that my beliefs are correct:
My belief is that if you keep the production server updated, the commit will frequently change. The goal is to observe the current production commit and set it accordingly on the UAT servers.

Thanks, Chuck

Just use sources.json from your nix directory (managed by niv).

Yeah this can be achieved be e.g. running the setup described twice, but then instead of having two nix directories, make both use the same one. The nixpkgs/path.nix file specifies where the Nixpkgs comes from, that's where you'll have to adjust one version to take the nix/sources.nix path from the other.