-
-
Notifications
You must be signed in to change notification settings - Fork 2k
manpages of host OS are not visible for me #432
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
Comments
(fwiw, I have the same errors and misbehavior, also on Ubuntu 16.04)
…On Mon, Oct 29, 2018, 14:18 Mateusz Czapliński ***@***.***> wrote:
I cannot seem to be able to access the manpages of my host Ubuntu 16.04
LTS distribution with HM installed, when using the seemingly HM-provided
man:
$ man bash/home/akavel/.nix-profile/bin/man: can't set the locale; make sure $LC_* and $LANG are correctNo manual entry for bash
$ ls -l `which man`lrwxrwxrwx 1 akavel akavel 69 sty 1 1970 /home/akavel/.nix-profile/bin/man -> /nix/store/1xq6j8hdcpd25zvhmsazfypxy37y8l87-home-manager-path/bin/man
$ /usr/bin/man bash | head -n4BASH(1) General Commands Manual BASH(1)
NAME bash - GNU Bourne-Again SHell
Actually, there seem to be 3 problems with man; to me they kinda seem to
faintly hint at some possible issue with environment variables maybe not
being accessible to man (??? or no default values for them? or maybe
actually being "set to empty" instead of being "unset"; IIRC, bash
differentiates those two states...), but I'm not sure about it. The
problems are:
1. the host manpages are not visible (as shown in the snippet above);
2. man displays this weird message about locale: can't set the locale;
make sure $LC_* and $LANG are correct;
3. also, if it displays a known page (for a Nix-installed command), it
doesn't filter it through less — it just dumps it in entirety,
scrolling past to the end; like if it had some problems getting a default
value for $PAGER (I have it empty, but the OS man correctly defaults
to less; if I do PAGER= /usr/bin/man bash, the host man also dumps
everything at once; if I do PAGER=less man home-configuration.nix, the
Nix man correctly uses less as pager).
I tried to reduce the *home.nix* to the smallest example, and it seems to
happen to me with the most basic HM config already, as shown below:
$ cat ~/.config/nixpkgs/home.nix{ programs.home-manager.enable = true; programs.home-manager.path = https://github.com/rycee/home-manager/archive/master.tar.gz;}
Any hints what could I try to do to improve the situation? Some
wrapProgram trickery maybe? Currently, I'm coping with calling
/usr/bin/man when I need, and man home-configuration.nix |& less when I
need that one, but I'd love to have them integrated in a transparent way :)
Maybe it's a problem in nixpkgs, rather than in HM?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#432>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACNoMUFCuUyDmKc5Ie7tLLa5gpMcOOGXks5up3CxgaJpZM4YAcui>
.
|
Just noticed that the "LC_ALL" message also gets displayed for me just after I open a new terminal window:
though I'm not sure how this can happen? I don't see any calls that could obviously do that in the script added to my |
Thanks for the very detailed report! I think this is an upstream issue but I'm guessing they would say not to use the man package from Nixpkgs on non-NixOS installs 🙂 So I think you might be best off not using the man module but instead just putting home.extraOutputsToInstall = [ "man" ]; in your configuration to make sure the man outputs are installed. Using your system man package should be able to view man pages installed through Nixpkgs since if [ -n "${MANPATH}" ]; then
export MANPATH="$NIX_LINK/share/man:$MANPATH"
fi About And about the |
So I should set edit: Also, I seem to have empty edit 2: I tried:
but |
Sorry! I forgot that part. You have to set `programs.man.enable = false`: See https://rycee.gitlab.io/home-manager/options.html#opt-programs.man.enable
…On October 31, 2018 12:06:08 AM GMT+01:00, "Mateusz Czapliński" ***@***.***> wrote:
So I should set `manual.manpages.enable = false;` apart from the
`extraOutputsToInstall`, right? (it seems that when unspecified, it is
by default `true`)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#432 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Wooohooo, it worked! ❤️ $ cat ~/.nixpkgs/config/home.nix
...
programs.man.enable = false;
home.extraOutputsToInstall = [ "man" ];
...
$ home-manager switch
$ man
bash: /home/akavel/.nix-profile/bin/man: No such file or directory
$ hash -d man
$ man
What manual page do you want?
$ man bash
...
$ man home-configuration.nix
... Though I don't really understand why it works even for home-configuration.nix :) given that I don't have $MANPATH set... hmm; but maybe some builtin Anyway, HUGE THANKS!!! And by the way, would you consider somehow making this attribute default to |
Mhh I just stumbled upon this, the problem was that the
But of course you can just set it in your home.nix config file:
|
ah that with see |
- Disable man nix-community/home-manager#432 - Install direnv
This module installs manual pages without hiding the operating system's existing manual pages. I wrote this module because the manual pages for XCode Command Line Tools on macOS were not showing up with the default Home Manager configuration. A similar issue was reported at nix-community/home-manager#432.
I cannot seem to be able to access the manpages of my host Ubuntu 16.04 LTS distribution with HM installed, when using the seemingly HM-provided
man
:Actually, there seem to be 3 problems with
man
; to me they kinda seem to faintly hint at some possible issue with environment variables maybe not being accessible toman
(??? or no default values for them? or maybe actually being "set to empty" instead of being "unset"; IIRC, bash differentiates those two states...), but I'm not sure about it. The problems are:can't set the locale; make sure $LC_* and $LANG are correct
;less
— it just dumps it in entirety, scrolling past to the end; like if it had some problems getting a default value for$PAGER
(I have it empty, but the OSman
correctly defaults toless
; if I doPAGER= /usr/bin/man bash
, the hostman
also dumps everything at once; if I doPAGER=less man home-configuration.nix
, the Nixman
correctly usesless
as pager).I tried to reduce the home.nix to the smallest example, and it seems to happen to me with the most basic HM config already, as shown below:
Any hints what could I try to do to improve the situation? Some
wrapProgram
trickery maybe? Currently, I'm coping with calling/usr/bin/man
when I need, andman home-configuration.nix |& less
when I need that one, but I'd love to have them integrated in a transparent way :)Maybe it's a problem in nixpkgs, rather than in HM?
edit: I got a suspicion that it might be Nix's patchelf replacing some default paths in the
man
binary; it appears to me that this may be a correct suspicion:edit 2: I compared the host's manpath.config vs. Nix's man_db.conf, and the latter seems to have many paths replaced with
/run/current-system/sw/share/man
. Do I understand correctly that this is a path that's available only in NixOS? Which would mean that nixpkgs'man
seems to have some NixOS-specific tweaks hardcoded?Click to expand the full diff
Though this still doesn't explain the problems with LC_ALL and PAGER to me.
The text was updated successfully, but these errors were encountered: