Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/nix/nix-build/nix-build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ static void main_nix_build(int argc, char ** argv)
auto tz = getEnv("TZ");
auto tzExport = tz ? "export TZ=" + escapeShellArgAlways(*tz) + "; " : "";
std::string rc = fmt(
(R"(_nix_shell_clean_tmpdir() { command rm -rf %1%; };)"s
("#!%8%\n" + R"(_nix_shell_clean_tmpdir() { command rm -rf %1%; };)"s
"trap _nix_shell_clean_tmpdir EXIT; "
"exitHooks+=(_nix_shell_clean_tmpdir); "
"failureHooks+=(_nix_shell_clean_tmpdir); ") +
Expand Down Expand Up @@ -649,7 +649,7 @@ static void main_nix_build(int argc, char ** argv)
escapeShellArgAlways(dirOf(*shell)),
escapeShellArgAlways(*shell),
tzExport,
envCommand);
envCommand, *shell);
vomit("Sourcing nix-shell with file %s and contents:\n%s", rcfile, rc);
writeFile(rcfile, rc);

Expand Down
1 change: 1 addition & 0 deletions tests/functional/user-envs.builder.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash
# shellcheck shell=bash
# shellcheck disable=SC2154
mkdir "$out"
Expand Down
Loading