Installing older version of package than available?

Due to how flox packages work, there are 3 stabilities. But what if I want to install really old package that is not in there? Is there an option to subscribe to nixpkgs?

There is a community tool to find which nixpkgs hash has which package version but it’s something I would like to avoid using as it’s not a way I want to work with it :slight_smile:

Yes you should still be able to install older packages using an inline declaration ( we are making progress on allowing this from the CLI in the future though ).

So lets say you used a search tool like the one you linked to find an old release of terraform at 1.0.7.

$ flox edit -e my-env;
# Write your inline package like this.
# Replace that `rev' with whatever you'd like.
{
  inline.packages.terraform = { system, ... }: let
    nixpkgs = builtins.getFlake
                "github:NixOS/nixpkgs/f8f124009497b3f9908f395d2533a990feee1de8";
  in nixpkgs.legacyPackages.${system}.terraform;
}
1 Like

Glad to help, I also realized that this should work as well. Let me know if you have any further questions.

{
  packages."github:NixOS/nixpkgs/<REV>".terraform = {};
}

This does not work, Nix tried to download https://api.github.com/repos/NixOS/nixpkgs/commits/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a/79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a for some reason

Do you mean that the second option didn’t work? Or did the first fail as well?

the second, the first works

Great thanks for clarifying.

I’m trying to install MySQL 5.7 but it seems like something has changed and this doesn’t work anymore?

What is the right way of installing old stuff? Here is the version I’m trying to install:

https://lazamar.co.uk/nix-versions/?package=mysql&version=5.7.39&fullName=mysql-5.7.39&keyName=mysql57&revision=6babc092caf5ed6744d5eb49f7d233dbb3c4f1ef&channel=nixos-22.11#instructions

Just a heads up, I know zero things about Nix.

Thank you all!

it seems like something has changed

This is true, this conversation was referring to an older version.

Right now Flox has a built in search catalog based on Nixpkgs 23.11 (you can read a bit about it here What is the Flox Catalog? - Flox Docs ). This means only the later versions of software are available (and not 5.7 that you are looking for)

We’re aware that this isn’t a great experience (people need specific versions of things!) and we are currently in the process of exposing multiple versions/revisions of Nixpkgs to Flox and broadening the amount of software that is available so you could flox show mysql and get a large list of versions hopefully inclusive of the version you’re targeting.

For now this means with Flox you only have later versions of the packages available. I created this tracking ticket to hang this and other tickets off of Flox search, install, and show by multiple versions · Issue #1197 · flox/flox · GitHub

1 Like