[Nix-dev] Picking a GHC version to use

Andres Loeh ksnix at andres-loeh.de
Tue Oct 30 08:41:46 CET 2012


Hi Richard.

I've tried to summarize most of the relevant information a while ago
on the page http://nixos.org/wiki/Haskell

It's certainly not perfect, but perhaps it helps you. I'll
additionally try to answer your questions below:

> I've installed the haskell-platform and that was easy enough, just
> `nix-evn -i haskell-haskell-platform-ghc7.4.2-2012.2.0.0`.

Yes, that should work as a starting point.

> Then I went on to try installing some other haskell packages, and they
> triggered an install of ghc 7.4.1 when I already have 7.4.2 installed
> and want to use that.

There's currently a global default GHC version, which is currently set
to 7.4.1 and will soon move to 7.4.2 when the next platform is
released. Note that you're not in any way required to use the global
default version, but if you select a package without explicitly
mentioning the compiler version (as you did for the Haskell Platform
above), then you'll get the default.

> I also tried using cabal2nix to install cabal-dev, but that failed
> because it was looking for package versions of mtl and tar that
> weren't installed.

I thought that cabal-dev is actually a part of nixpkgs, but it seems
it isn't. I'll look into it. Generally, the need for cabal-dev mostly
disappears when using NixOS/nixpkgs. I just have (lots of) different
Nix profiles for different projects. That being said, I have
successfully been using cabal-dev on top of NixOS, too. In general, if
you have dependency problems, you can (a) try to pass explicit
versions of certain packages to an expression in haskell-packages.nix,
or (b) use "jailbreak = true;" in the Nix expression for the package
to have it ignore its dependency bounds, or (c) a combination of the
two.

Cheers,
  Andres


More information about the nix-dev mailing list