nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

Explain (briefly) how to get an archive link

Open ChrisJefferson opened this issue 3 years ago • 5 comments

In https://nix.dev/tutorials/ad-hoc-developer-environments.html#towards-reproducibility , nixpkgs is explictly set to an archive link.

It would be nice if it was described how to get this link -- even better if nix had an easy way of providing it, so I could quickly snapshot "my current" nix install to send to other people.

ChrisJefferson avatar Aug 26 '20 08:08 ChrisJefferson

Would it suffice to say:


Check release status to get the latest tested commit.

domenkozar avatar Aug 26 '20 10:08 domenkozar

It would be even nicer to have a command of what I'm actually using, as I didn't know which nix I was on.

I think I have to type:

nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version', then take the stuff after the last dot? That is reasonably horrible of course. You could on that page say "this is a (whatever version)", then link this somewhere else?

ChrisJefferson avatar Aug 26 '20 11:08 ChrisJefferson

nix-instantiate --eval -E '(import <nixpkgs> {}).lib.trivial.versionSuffix' is closer.

ChrisJefferson avatar Aug 26 '20 11:08 ChrisJefferson

Maybe that should be a reference section on it's own, as there are quite a few ways how to source the git version.

domenkozar avatar Aug 26 '20 12:08 domenkozar

This comes up often enough for me that I wrote a script to give me the archive link of <nixpkgs>.

mkohler avatar Jun 24 '22 21:06 mkohler