nixpkgs-multiverse: every version that ever existed

18 points by domenkozar


domenkozar

I got really excited when Farid showed me this!

He has fixed the oldest and most upvoted issue on devenv: https://github.com/cachix/devenv/issues/16

Basic example in devenv:

{ multiverse, ... }: {
  packages = [
    multiverse.cmake."3.16.5"
    multiverse.bun."0.7.0"
  ];
}

Docs: https://devenv.sh/pinning/#pinning-an-individual-package-version

lilyball

I was just thinking recently about the possibility of doing something like this, but the problem that I got hung up on was how to minimize the number of duplicate dependencies between different packages. When I say "duplicate" I mean semantically the same dependency but there being some trivial difference causing it to be a different instantiation of it.

Every package version exists in a whole range of revisions. Across that range of revisions the package may end up having multiple instantiations due to changes in its dependencies (or in stdenv or the per-language build environment). Which one do you pick? This blog post says to pick the newest revision, which is a simple answer but can be inefficient. If I want 3 different packages, maybe all 3 could be fetched from a single nixpkgs revision, but a naive "use the latest revision" approach likely means ending up with 3 different nixpkgs revisions. And not only does that mean 3 copies of nixpkgs, but if these 3 packages have a bunch of common dependencies, using different nixpkgs revisions for each package may mean getting different instantiations of the dependencies too.

So it would be great if there was a way to try to minimize the number of nixpkgs revisions fetched for a set of packages by looking for overlap in the revision ranges for those packages. But for each nixpkgs input you need there's still a range of revisions to pick from, which means there's opportunity here for picking revisions that minimize the number of instantiations of shared dependencies. I don't know how much data you'd need to collect and download to be able to actually solve that problem though.

lilyball

Does this not include nested package sets? I just fired up the repl and I don't see python3Packages in here. I assume that python3.pkgs would exist but that would be tied to changes to the python3 derivation, meaning no way to fetch individual python packages by version.

bjth

Perhaps a very stupid question. But would it make sense to try and upstream this? Or is there little chance this would survive nixpkgs' review?