infinisil / sanix

Sane stable stateless NixOS setup
47 stars 1 forks source link

Find and Pin to Specific Commit of nixpkgs #4

Open cboecking opened 2 months ago

cboecking commented 2 months ago

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:

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

benjumanji commented 2 weeks ago

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

infinisil commented 2 weeks ago

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.