Jogger
Jogger

Reputation: 1709

Nix channels and GHC/Hackage package versions

I'm currently working through Gabriel's tutorial on Nix and Haskell.

In nix there are channels and they contain (similar to the Stack LTS versions) a curated set of Hackage packages and a GHC compiler.

For every LTS version Stackage shows the version of the GHC compiler and the version of every Hackage package. Where can I lookup this information for the nix channels before I start using the channel ?

Upvotes: 2

Views: 692

Answers (2)

Marcelo Lazaroni
Marcelo Lazaroni

Reputation: 10237

Given a revision hash, let's say 683c68232e91f76386db979c461d8fbe2a018782, you can list all packages from that revision with

nix-env -qaP -f https://github.com/NixOS/nixpkgs-channels/archive/683c68232e91f76386db979c461d8fbe2a018782.tar.gz

You can also mix and match packages from different revisions. The only shortcoming there is that there is no official way to search old versions of a package.

I wrote https://lazamar.co.uk/nix-versions to help with that. It shows all past versions of a package, what derivations they are from and how to install them.

Upvotes: 2

Jogger
Jogger

Reputation: 1709

For the version of the Haskell packages I have found an answer: There are files like https://raw.githubusercontent.com/NixOS/nixpkgs/release-16.09/pkgs/development/haskell-modules/hackage-packages.nix. These files are not really easy to use ...

Edit

In this file I can search for = "base" then I can find the version of the base library. From the version of the base library I can lookup of the GHC version.

This gives the following table:

newest   -> base-4.10.0.0    -> GHC 8.2.1
17.09    -> base-4.10.0.0    -> GHC 8.2.1
17.03    -> base-4.9.1.0     -> GHC 8.0.2
16.09    -> base-4-9.0.0     -> GHC 8.0.1
16.03    -> base-4.8.2.0     -> GHC 7.10.3
15.09    -> base-4.8.2.0     -> GHC 7.10.3

However a simpler method would be nice...

Upvotes: 1

Related Questions