haskellLib: Add shellAware function

This commit is contained in:
Shea Levy 2018-01-10 12:08:36 -05:00
parent 65b075991f
commit 3a763b9196
No known key found for this signature in database
GPG key ID: 5C0BD6957D86FE27

View file

@ -154,6 +154,10 @@ rec {
(p.override { mkDerivation = extractBuildInputs p.compiler;
}).haskellBuildInputs;
# Under normal evaluation, simply return the original package. Under
# nix-shell evaluation, return a nix-shell optimized environment.
shellAware = p: if lib.inNixShell then p.env else p;
ghcInfo = ghc:
rec { isCross = (ghc.cross or null) != null;
isGhcjs = ghc.isGhcjs or false;