nix.dev
nix.dev copied to clipboard
Explain (briefly) how to get an archive link
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.
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?
nix-instantiate --eval -E '(import <nixpkgs> {}).lib.trivial.versionSuffix' is closer.
Maybe that should be a reference section on it's own, as there are quite a few ways how to source the git version.
This comes up often enough for me that I wrote a script to give me the archive link of <nixpkgs>.