diff options
author | Florian Friesdorf <flo@chaoflow.net> | 2011-12-29 20:09:30 +0000 |
---|---|---|
committer | Florian Friesdorf <flo@chaoflow.net> | 2011-12-29 20:09:30 +0000 |
commit | 89c3120b202355910f4869b297c43618f8f93394 (patch) | |
tree | f2f1e8488c79dd539e4e285f5c913d3bef068c4d /pkgs/shells | |
parent | 0009c1f650ba619de97df36322fbd0346db0c099 (diff) |
zsh profile load tweaking only on nixos
svn path=/nixpkgs/trunk/; revision=31149
Diffstat (limited to 'pkgs/shells')
-rw-r--r-- | pkgs/shells/zsh/default.nix | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/pkgs/shells/zsh/default.nix b/pkgs/shells/zsh/default.nix index 61deeb4869dcb..6b199e165d0dc 100644 --- a/pkgs/shells/zsh/default.nix +++ b/pkgs/shells/zsh/default.nix @@ -31,17 +31,25 @@ stdenv.mkDerivation { tar xf ${documentation} -C $out/share ensureDir $out/etc/ cat > $out/etc/zprofile <<EOF -if test -r /etc/zprofile; then - . /etc/zprofile +if test -e /etc/NIXOS; then + if test -r /etc/zprofile; then + . /etc/zprofile + else + emulate bash + alias shopt=false + . /etc/profile + unalias shopt + emulate zsh + fi + if test -r /etc/zprofile.local; then + . /etc/zprofile.local + fi else - emulate bash - alias shopt=false - . /etc/profile - unalias shopt - emulate zsh -fi -if test -r /etc/zprofile.local; then - . /etc/zprofile.local + # on non-nixos we just source the global /etc/zprofile as if we did + # not use the configure flag + if test -r /etc/zprofile; then + . /etc/zprofile + fi fi EOF $out/bin/zsh -c "zcompile $out/etc/zprofile" |