Nix Flakes - How to install a specific older version of an app

Hi
Converting from nix channels to nix flakes. All is well so far. Next issues is
how to install an older version of audacity, predating telemetry issues.
In ix channels I could select audacity 2.3.2 from Nix Package Versions and run: nix-env -iA audacity -f https://github.com/NixOS/nixpkgs/archive/b5b7bd6ebba2a165e33726b570d7ab35177cf951.tar.gz

  1. How do I do this with nix profile?
  2. Can I pin the package so it will not change when I do an update? Maybe with a
    lockfile?
  3. Can I create an appimage of it?

I tried
nix profile install nixpkgs/b5b7bd6ebba2a165e33726b570d7ab35177cf951#audacity
but got error: getting status of ‘/nix/store/7mgzqmz0h4bnls36jimk4krqlrkbl3w8-source/flake.nix’: No such file or directory

Thanks

Murray

That particular commit has been made long before the flake.nix was added.

It got added in 8eaf02b9cd35def36217d39812b7c656de307c58 (Feb 2020).

Though that is incompatible with how flakes work today.

The first I can find that would work with the modern CLI was 97fc8af29b59acc55e7544a2e86b8941f9257b1e (June 2020), which provides Audacity 2.4.1:

$ nix eval nixpkgs/97fc8af29b59acc55e7544a2e86b8941f9257b1e#audacity.version
"2.4.1"

What might work is to create your own flake, that loads that old nixpkgs commit you need as a flake input with flake = false, imports it and exposes the audacity version.

Instead though I would suggest to use one of the many forks that came up, as I understand it, because of the telemetry issues you mention.

I’ll assume you know how to build it (flake-less). Then you can at least do nix profile install /nix/store/somepath… but yes, not nice.

PS: nix profile inherits a lot of the problems nix-env and apt have as well due to their imperative nature. You might prefer declarative approaches.

1 Like

Thanks for the reply,
Can’t create a flake yet, to do list.

Maybe third part website will convert to nix profile sometime.

Murr

Thanks for the reply. Appreciated

Murr