Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

redbaron
Copy link
Contributor

It makes man pages from installed nix packages available to host's
man utility.

It makes man pages from installed nix packages available to host's
man utility.
@edolstra
Copy link
Member

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.

@redbaron
Copy link
Contributor Author

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

@redbaron
Copy link
Contributor Author

ping

@vcunat
Copy link
Member

vcunat commented Mar 18, 2014

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.

@redbaron
Copy link
Contributor Author

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

@vcunat
Copy link
Member

vcunat commented Mar 18, 2014

Yes, my meaning is that there are dozens of other similar variables.

@domenkozar
Copy link
Member

This was done in 76f985b and can be closed

@redbaron
Copy link
Contributor Author

redbaron commented Jul 1, 2015

thx

@redbaron redbaron closed this Jul 1, 2015
@edolstra
Copy link
Member

edolstra commented Jul 1, 2015

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 $PATH.

@domenkozar
Copy link
Member

It "breaks" how exactly?

@fhaust
Copy link

fhaust commented Nov 23, 2015

Problem is that this is a thing if the MANPATH isn't set properly:

$ nix-env
error: no operation specified
Try ‘nix-env --help’ for more information.
$ nix-env --help
No manual entry for nix-env
See 'man 7 undocumented' for help when manual pages are not available.

@vcunat
Copy link
Member

vcunat commented Nov 23, 2015

@fhaust: it should be, at least on NixOS.

@fhaust
Copy link

fhaust commented Nov 23, 2015

@vcunat Probably, but I am not on NixOS but on a "nix on Ubuntu as non-root via proot" installation :)

@redbaron
Copy link
Contributor Author

@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

@fhaust
Copy link

fhaust commented Nov 24, 2015

So this is probably a won't fix case? For me setting the MANPATH manually is fine.

@redbaron
Copy link
Contributor Author

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

@edolstra
Copy link
Member

@redbaron Yeah, I think that would work.

@domenkozar
Copy link
Member

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
Copy link

@sanscore sanscore Aug 23, 2016

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

@sanscore
Copy link

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 MANPATH=; nix-env --help.

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.

@sanscore
Copy link

sanscore commented Aug 23, 2016

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

cvogt added a commit to cvogt/fish that referenced this pull request May 21, 2017
zolodev pushed a commit to zolodev/nix that referenced this pull request Jan 1, 2024
…ook-theme-0.2.0

chore(deps): bump sphinx-book-theme from 0.1.10 to 0.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants