aboutsummaryrefslogtreecommitdiff
path: root/scripts/nix-profile.sh.in
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2016-07-29 13:00:11 +0300
committerDomen Kožar <domen@dev.si>2016-07-29 12:00:11 +0200
commiteef754813f5a9d77ceeb0f10981d0a324967dc02 (patch)
treea4f70fd2120ea6ecfd94ec468e59b01a905dad77 /scripts/nix-profile.sh.in
parentee22a91ab847f63a22466f3bf63e33ca29da9cfe (diff)
Set $MANPATH (#1005)
Currently, man has issues finding man pages for Nix-installed application (also, `nix-env --help` doesn't work). The issue is caused by custom `$MANPATH` set by my system. That makes man use it instead of searching in default location. Either of next lines workaround the issue: ```sh unset MANPATH export MANPATH=$HOME/.nix-profile/share/man:$MANPATH ``` This patch adds the later line to the `nix-profile.sh` if user has `MANPATH` set. (Not clearing `MANPATH` as that would be disrespect of user's preferences.) As a side-effect, host's man might find man pages installed by Nix.
Diffstat (limited to 'scripts/nix-profile.sh.in')
-rw-r--r--scripts/nix-profile.sh.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index cfe05c716..41111848b 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -81,6 +81,10 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
export SSL_CERT_FILE="$NIX_LINK/etc/ca-bundle.crt"
fi
+ if [ -n ${MANPATH} ]; then
+ export MANPATH="$NIX_LINK/share/man:$MANPATH"
+ fi
+
export PATH="$NIX_LINK/bin:$NIX_LINK/sbin:$__savedpath"
unset __savedpath NIX_LINK NIX_USER_PROFILE_DIR NIX_PROFILES
fi