Skip to content

Commit

Permalink
haskellLib: Add shellAware function
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Jan 10, 2018
1 parent 65b0759 commit 3a763b9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/development/haskell-modules/lib.nix
Expand Up @@ -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;
Expand Down

0 comments on commit 3a763b9

Please sign in to comment.