From 944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 11 Feb 2009 16:12:12 +0000 Subject: [PATCH] my-env: add some hackish support for zsh svn path=/nixpkgs/trunk/; revision=14034 --- pkgs/misc/my-env/default.nix | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix index 2bf2d86c2c81..4d06a8b5c8e3 100644 --- a/pkgs/misc/my-env/default.nix +++ b/pkgs/misc/my-env/default.nix @@ -69,7 +69,40 @@ mkDerivation { phases= # only do all the setup stuff in nix-support/* set +e - source "$s" + if [[ -z "\$ZSH_VERSION" ]]; then + source "$s" + else + setopt interactivecomments + # fix bash indirection + # let's hope the bash arrays aren't used + # substitute is using bash array, so skip it + echo ' + setopt NO_BAD_PATTERN + setopt NO_BANG_HIST + setopt NO_BG_NICE + setopt NO_EQUALS + setopt NO_FUNCTION_ARGZERO + setopt GLOB_SUBST + setopt NO_HUP + setopt INTERACTIVE_COMMENTS + setopt KSH_ARRAYS + setopt NO_MULTIOS + setopt NO_NOMATCH + setopt RM_STAR_SILENT + setopt POSIX_BUILTINS + setopt SH_FILE_EXPANSION + setopt SH_GLOB + setopt SH_OPTION_LETTERS + setopt SH_WORD_SPLIT + ' >> "\$tmp/script" + sed -e 's/\''${!\([^}]*\)}/\''${(P)\1}/g' \ + -e 's/[[]\*\]//' \ + -e 's/substitute() {/ substitute() { return; /' \ + -e 's@PATH=\$@PATH=${pkgs.coreutils}/bin@' \ + "$s" >> "\$tmp/script" + echo "\$tmp/script"; + source "\$tmp/script"; + fi rm -fr "\$tmp" ${extraCmds} export PATH