This way, all your versions of packages will be pinned to this specific revision, and you can also use multiple revisions at the same time.
If you want to deal with N separate programs that are each pinned independently, you will point to N different revisions of Nixpkgs.
One NixOS configuration file can point to several different specific revisions of Nixpkgs. This is done with a so called "import from derivation" in the Nix expression language.
You can look at this page (scroll to the bottom to skip backwards compatibility):
https://nixos.wiki/wiki/How_to_fetch_Nixpkgs_with_an_empty_N...
There "pkgs" becomes defined as a specific Nixpkgs revision regardless of which revision is used by "nixos-rebuild" for example.
This would all be clearer with a real example, sorry...
I actually don't really understand how this is handled in other package-managers as well. B/c in the case of libraries, having 2 versions floating around can lead to double linking and duplicate symbols and all sorts of subtle problems.
In the case of OpenSSL, Nixpkgs currently has two packages named openssl_1_0_2 and openssl_1_1, with openssl being an alias for latter.
Different programs depending on different versions can be installed at the same time without conflict. Full paths to dynamic library files are used in binaries instead of relying on a global library path.
The description of the build inputs has references to the definitions of other packages which have references to the exact version of the source code or commit hash or whatever (and hopefully has a hash of whatever is supposed to be downloaded). Therefore to get a full description one must expand all the other definitions. I don’t know how to do this in guix/nix but I suppose one might say “this package definition with this commit of this repo of package definitions.
Pinning to a specific version seems to be a different issue and I don’t really know anything about that
Say I have a service I run that acts as a frontend for something like nmap. So there is pkgs/tools/security/nmap/default.nix that installs 7.70
How do I 'pin' that version? If I vendor that file into my configuration, that could work, but then the buildinputs are
And the dependencies for libpcap and openssl are themselves not pinned to specific versions, so how exactly do I get a reproducible build?