zsh profile load tweaking only on nixos

svn path=/nixpkgs/trunk/; revision=31149
This commit is contained in:
Florian Friesdorf 2011-12-29 20:09:30 +00:00
parent 0009c1f650
commit 89c3120b20
1 changed files with 18 additions and 10 deletions

View File

@ -31,6 +31,7 @@ stdenv.mkDerivation {
tar xf ${documentation} -C $out/share
ensureDir $out/etc/
cat > $out/etc/zprofile <<EOF
if test -e /etc/NIXOS; then
if test -r /etc/zprofile; then
. /etc/zprofile
else
@ -43,6 +44,13 @@ fi
if test -r /etc/zprofile.local; then
. /etc/zprofile.local
fi
else
# 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"
mv $out/etc/zprofile $out/etc/zprofile_zwc_is_used