New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MANPATH handling to nix-profile #229
Conversation
It makes man pages from installed nix packages available to host's man utility.
This is actually distribution-dependent. Some man implementations will automatically search in ../share/man relative to every $PATH directory, so you don't need to set $MANPATH. But I gues it doesn't hurt to set it explicitly. |
yes it does, but only if MANPATH isn't set already. Some host packages can set it explicitly (like openpmi on my OpenSUSE system) and then access to nixpkgs man pages is lost |
ping |
On nixos this is set correctly by https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/environment.nix In fact, I think in future it might be nice if each user/system environment exposed the variable values it expects to be set (perhaps a script that sets them). Practically each variable is triggered by some specific package/framework, so it seems better to modularize this. |
nixpkgs can be used on other linux systems, this profile file is the only way to integrate it to host environment. If PATH is set there, why don't set MANPATH too |
Yes, my meaning is that there are dozens of other similar variables. |
This was done in 76f985b and can be closed |
thx |
Eh. I didn't notice that commit. I'll revert - setting MANPATH is actually a bad idea, because it breaks systems that have an implicit default derived from |
It "breaks" how exactly? |
Problem is that this is a thing if the
|
@fhaust: it should be, at least on NixOS. |
@vcunat Probably, but I am not on NixOS but on a "nix on Ubuntu as non-root via proot" installation :) |
@fhaust same for me, without patch it wasn't working currectly in that setup. Partially because by default on my distro (opensuse) I already have MANPATH setup, therefore manpath autodetection based on PATH var doesn't work, hence my change to add it there explicitly |
So this is probably a |
I wonder if they accept patch with conditional assignment. If MANPATH is present, then modify it, if not, then rely on man to try to find man pages relative to PATH |
@redbaron Yeah, I think that would work. |
Anyone up for fixing this? |
@@ -9,6 +9,7 @@ if test -n "$HOME"; then | |||
fi | |||
|
|||
export PATH=$NIX_LINK/bin:$NIX_LINK/sbin:$PATH | |||
export MANPATH=$NIX_LINK/share/man:$MANPATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [ -n "$MANPATH" ]; then
export MANPATH=$NIX_LINK/share/man:$MANPATH
fi
I'm using NIX on OS X -- NIX as a OS X Package Manager -- and I am experiencing this issue. Having read the conversation, the workaround is I've, also, contributed a comment to PR which should be an amicable fix. Simply, check if MANPATH is set before append+export. I'll give @redbaron time to amend and to contribute the fix. If not, then I'll create a new PR. |
Actually, it's already been fixed, but the current release must not have it; I just installed in the past hour. #1005 $ nix-env --version
nix-env (Nix) 1.11.2 |
…ook-theme-0.2.0 chore(deps): bump sphinx-book-theme from 0.1.10 to 0.2.0
It makes man pages from installed nix packages available to host's
man utility.