diff options
author | Marc Weber <marco-oweber@gmx.de> | 2009-02-11 16:12:12 +0000 |
---|---|---|
committer | Marc Weber <marco-oweber@gmx.de> | 2009-02-11 16:12:12 +0000 |
commit | 944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5 (patch) | |
tree | e2c60dc387f335ad842425b9d438d55c2d4b0c80 /pkgs/misc/my-env/default.nix | |
parent | ca5e6b9624c39bb262e5580613a421de2bedea0f (diff) | |
download | nixpkgs-944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5.tar nixpkgs-944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5.tar.gz nixpkgs-944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5.tar.bz2 nixpkgs-944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5.tar.lz nixpkgs-944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5.tar.xz nixpkgs-944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5.tar.zst nixpkgs-944d6221df8c60d0e2741bc9fd5e14d62f1e8ee5.zip |
my-env: add some hackish support for zsh
svn path=/nixpkgs/trunk/; revision=14034
Diffstat (limited to 'pkgs/misc/my-env/default.nix')
-rw-r--r-- | pkgs/misc/my-env/default.nix | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix index 2bf2d86c2c8..4d06a8b5c8e 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 |