[Nix-dev] Re: Building an old GHC for a new Cabal...

Andres Loeh andres.loeh at googlemail.com
Thu May 13 10:12:42 CEST 2010


Hi Jason.

I'm glad you were able to figure it out. Here is a bash script that I
am personally using to maintain different profiles for different ghc
versions. I call it nix-env-ghc:

w=$1
v=$(echo $1 | sed 's/\.//g')
p=$2
shift 2
nix-env -p $NIX_USER_PROFILE_DIR/ghc-$w -iA
nixpkgs_sys.haskellPackages_ghc$v.$p $*

I can then install a package for a specific version of ghc with a
little less typing effort

nix-env-ghc 6122 cabalInstall080

This will end up in a ghc-version-specific profile automatically. I
have another script that lets me easily switch default paths between
different ghc versions. The script could certainly be made much more
clever, but it covers most of my use cases. Perhaps such a setup is
useful to you, too.

Cheers,
  Andres



More information about the nix-dev mailing list