[Nix-dev] Picking a GHC version to use

Richard Wallace rwallace at thewallacepack.net
Tue Oct 30 17:29:53 CET 2012


On Tue, Oct 30, 2012 at 12:41 AM, Andres Loeh <ksnix at andres-loeh.de> wrote:
> Hi Richard.
>
> I've tried to summarize most of the relevant information a while ago
> on the page http://nixos.org/wiki/Haskell
>

Oh cool. I think I saw that a week ago but completely missed it last
night when actually trying out nix.  Looks really helpful, thanks!

> 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.
>

Ok, I guess I'm just not sure how to specify the compiler version.
When I ran `nix-env -qa | grep cabal-dev` after adding the .nix file
and modifying haskell-packages.nix, I saw something like 6
cabal-dev-0.9.1 possibilities.  I figured that those were different
derivations, but didn't know how to see more information about the
derivations or how to pick a specific one.

>> 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