How do I find an appropriate nixpkgs tarball?

I want to install an older version of a package currently in nixpkgs. I can find the nixpkgs revision that contains it, but fetching that revision is very likely to end up with packages that aren’t present in the binary cache. For this particular package I can likely fetch the 19.09 channel (it wouldn’t get me the latest usable version of the package but it would get me something close enough) but I’d really prefer to just get a tarball from nixpkgs-unstable that represents a historical state of the channel (for the binary caches) but contains the package version I want.

I did find https://lazamar.co.uk/nix-versions/ but it doesn’t seem to index language packages (what I’m looking for in this case is a python package). It also only takes snapshots every 5 weeks so it may not be suitable if I need a very specific version.

I think for my use case what I’d really like is either “show me the oldest nixpkgs-unstable channel state that contains a given commit” or “show me the newest nixpkgs-unstable channel state that doesn’t contain a given commit” (e.g. either the oldest channel state after the package version I want was introduced, or the newest before the package was revved to an incompatible version). But if there was also just a way to give me a list of nixpkgs-unstable channel states around a given time frame that I could just check that would work too.

1 Like

As far as I know, the binary cache (cache.nixos.org) does not delete anything. So I would just download that commit, and take the package from that commit. But be careful to not get a new gcc or anything else into that package. That would change the package.

The problem with just downloading the commit is all of the dependencies. If a channel was never published for that particular commit, then it may have a unique collection of dependencies that were never built for the binary cache. I’ve hit this problem before when trying to build packages from arbitrary nixpkgs commits.