Peter Simons <[email protected]> writes:
> I use the following "shell.nix" to switch between compiler versions:
>
>     { compiler ? "ghc7101" }:
>
>     with (import <nixpkgs> {}).pkgs;
>     let
>       ghc = haskell.packages.${compiler}.ghcWithPackages
>               (pkgs: with pkgs; [ aeson lens monad-par ]);
>     in
>     stdenv.mkDerivation {
>       name = "my-haskell-env-0";
>       buildInputs = [ ghc ];
>       shellHook = "eval $(grep export ${ghc}/bin/ghc)";
>     }
>
> Now run "nix-shell --argstr compiler ghc784" to select a compiler other
> than the default.

Neat trick!  Thanks for sharing.

-- 
Peter Jones, Founder, Devalot.com
Defending the honor of good code

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to