From 5af91a47423cf18b542833d3eb2105da1dbd7846 Mon Sep 17 00:00:00 2001 From: Yannik Sander Date: Mon, 30 Mar 2020 10:03:21 +0200 Subject: [PATCH] Fix pypi2nix failing to spawn shell Note: Although this is meant to fix an issue with pypi2nix I suspect this to also work on other projects which use nix-shell from a clean process. --- nix-shell.plugin.zsh | 4 ++-- scripts/buildShellShim.zsh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nix-shell.plugin.zsh b/nix-shell.plugin.zsh index 7277379..fde2999 100644 --- a/nix-shell.plugin.zsh +++ b/nix-shell.plugin.zsh @@ -29,7 +29,7 @@ function nix-shell() { then PURE=1 - # skip all other unary arguments + # skip all other unary arguments elif [[ $key == "-"* ]] then IN_PACKAGES=0 @@ -52,7 +52,7 @@ function nix-shell() { else NIX_SHELL_PACKAGES="$NIX_SHELL_PACKAGES" \ NIX_BUILD_SHELL="$NIX_SHELL_PLUGIN_DIR/scripts/buildShellShim.zsh" \ + NIX_EXECUTING_SHELL="$SHELL" \ command nix-shell "$@" fi } - diff --git a/scripts/buildShellShim.zsh b/scripts/buildShellShim.zsh index 702b53a..5d0a32c 100755 --- a/scripts/buildShellShim.zsh +++ b/scripts/buildShellShim.zsh @@ -6,7 +6,7 @@ if [ "$1" = "--rcfile" ]; then shift tmp="$(cat $1)" echo ${tmp%exit} > $1 - echo "zsh" >> $1 + echo $NIX_EXECUTING_SHELL >> $1 bash $1 else bash "$@"