[post] All the versions in Nix

I have a blog post here that might be interesting:

https://matthewbauer.us/blog/all-the-versions.html

9 Likes

That’s one post I’ve been expecting since I started Nixos. That could be one great strength of nixos but I guess we miss the UI/tooling to make this kind of scenario more accessible. Kudos for the writeup.

1 Like

Second paragraph ends with the truncated sentence

Like the previous post, it will come with a Nix snippet that


This confused me for a second:

builtins.hasAttr name pkgs && pkg ? name

because of the fact that the token name means two different things in each context.

I did a quick test and it looks like Nix 2.2.2 supports the syntax pkgs ? ${name}, which is fun (I was inspired by your use of pkgs.${name} to try this).

Thanks! It’s been updated.

Yeah it probably needs additional explanation but the first checks for the package in the package set, the second checks that the package actually has a name. Maybe pkg ? "name" would be more clear.

What improvements to the tooling would help? The power to install an arbitrary version of a piece of software (assuming that version has ever had a .nix file written for it) is huge, and I would be thrilled to see this integrated into the Nix core.

I have the idea to be able to use every version ever packaged since years. It should work since we define the dependencies clearly and every information is in git.

Inspired by this article and ideas i had, i have written a concept to implement that: Concept: use any package version

The first tests are very promising. I would like to get your feedback!