1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00
This commit is contained in:
9p4 2025-06-24 00:38:23 -07:00 committed by GitHub
commit 30e6aaa327
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 0 deletions

View file

@ -360,6 +360,8 @@ void MixEnvironment::setEnviron()
for (const auto & [name, value] : setVars)
env[name] = value;
env["IN_NIX_SHELL"] = ignoreEnvironment ? "pure" : "impure";
if (!unsetVars.empty())
std::erase_if(env, [&](const auto & var) { return unsetVars.contains(var.first); });

View file

@ -43,6 +43,7 @@ nix run -f shell-hello.nix env > $TEST_ROOT/actual-env
# - __CF_USER_TEXT_ENCODING is set by macOS and is beyond our control
sed -i \
-e 's/PATH=.*/PATH=.../' \
-e '/^IN_NIX_SHELL=.*/d' \
-e 's/_=.*/_=.../' \
-e '/^TMPDIR=\/var\/folders\/.*/d' \
-e '/^__CF_USER_TEXT_ENCODING=.*$/d' \

View file

@ -36,6 +36,7 @@ nix shell -f shell-hello.nix hello -c env > "$TEST_ROOT/actual-env"
# - __CF_USER_TEXT_ENCODING is set by macOS and is beyond our control
sed -i \
-e 's/PATH=.*/PATH=.../' \
-e '/^IN_NIX_SHELL=.*/d' \
-e 's/_=.*/_=.../' \
-e '/^TMPDIR=\/var\/folders\/.*/d' \
-e '/^__CF_USER_TEXT_ENCODING=.*$/d' \