about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2016-07-29T10·00+0300
committerDomen Kožar <domen@dev.si>2016-07-29T10·00+0200
commiteef754813f5a9d77ceeb0f10981d0a324967dc02 (patch)
treea4f70fd2120ea6ecfd94ec468e59b01a905dad77 /scripts
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')
-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 cfe05c7166e7..41111848b2f3 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