From 2b64bf66626fb10bdd733a25630aa2dff3dc73b2 Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 9 Dec 2024 12:46:14 +1000 Subject: [PATCH] tweak _exec helper --- docker-tools.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docker-tools.nix b/docker-tools.nix index 9d6636a..e9b55b2 100644 --- a/docker-tools.nix +++ b/docker-tools.nix @@ -156,12 +156,19 @@ in mkdir -p .${sandboxBuildDir} chown -R ${toString uid}:${toString gid} .${sandboxBuildDir} - cat < ./usr/bin/_exec + mkdir -p ./tmp + chmod a+rwx ./tmp + + cat <<'EOF' > ./usr/bin/_exec #!${shell} - unset shellHook + if [[ "$shell" != 1 ]]; then + oldShellHook="$shellHook" + unset shellHook + export noDumpEnvVars=1 + fi source ${rcfile} + exec "$@" EOF - echo 'exec "$@"' >> ./usr/bin/_exec chmod +x ./usr/bin/_exec '';