From 3a763b91963ef747b188e7062d7a02119d2ef6d3 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 10 Jan 2018 12:08:36 -0500 Subject: [PATCH] haskellLib: Add shellAware function --- pkgs/development/haskell-modules/lib.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix index 6a724130d25..da4e9c6777b 100644 --- a/pkgs/development/haskell-modules/lib.nix +++ b/pkgs/development/haskell-modules/lib.nix @@ -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;