From 15e5ac80393f3b0a1be264e8cdaa8f048375b27d Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Fri, 19 Jul 2013 14:32:05 +0200
Subject: [PATCH] nix-shell: Set $IN_NIX_SHELL

This allows scripts to distinguish between a real build and a Nix
shell.
---
 scripts/nix-build.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 404133ed8..b3a0f400f 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -188,6 +188,8 @@ foreach my $expr (@exprs) {
         $ENV{'NIX_STORE'} = $Nix::Config::storeDir;
         $ENV{$_} = $drv->{env}->{$_} foreach keys %{$drv->{env}};
 
+        $ENV{'IN_NIX_SHELL'} = 1;
+
         # Run a shell using the derivation's environment.  For
         # convenience, source $stdenv/setup to setup additional
         # environment variables and shell functions.  Also don't lose
-- 
GitLab