mirror of
https://github.com/NixOS/nix
synced 2025-07-09 03:43:54 +02:00
Add inNixShell = true to nix-shell auto-call
This is an alternative to the IN_NIX_SHELL environment variable, allowing the expression to adapt itself to nix-shell without triggering those adaptations when used as a dependency of another shell. Closes #3147
This commit is contained in:
parent
2f96a89646
commit
9d612c393a
3 changed files with 21 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
|||
{ }:
|
||||
{ inNixShell ? false }:
|
||||
|
||||
with import ./config.nix;
|
||||
|
||||
|
@ -22,6 +22,7 @@ let pkgs = rec {
|
|||
name = "shellDrv";
|
||||
builder = "/does/not/exist";
|
||||
VAR_FROM_NIX = "bar";
|
||||
TEST_inNixShell = if inNixShell then "true" else "false";
|
||||
inherit stdenv;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue