Set IN_NIX3_SHELL env variable in "nix shell"

Solving issue https://github.com/NixOS/nix/issues/3862

Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
This commit is contained in:
Alex Shabalin 2021-11-17 16:09:36 +01:00
parent 480c883f36
commit a83caea829

View file

@ -120,6 +120,7 @@ struct CmdShell : InstallablesCommand, MixEnvironment
} }
setenv("PATH", concatStringsSep(":", unixPath).c_str(), 1); setenv("PATH", concatStringsSep(":", unixPath).c_str(), 1);
setenv("IN_NIX3_SHELL", "1", 1);
Strings args; Strings args;
for (auto & arg : command) args.push_back(arg); for (auto & arg : command) args.push_back(arg);