Nix-env not linking man pages into environment?

I’m playing around with Nix in a Docker container based on lnl7/nix, and trying to get man pages working. I’m struggling to understand what controls which man pages are exposed.

The lnl7/nix:latest image has man pages for nix itself and coreutils:

$ docker run --rm -it lnl7/nix:latest ls "/run/current-system/sw/share/man/man1"
b2sum.1.gz      fmt.1.gz                  nix-store.1.gz  split.1.gz
base32.1.gz     fold.1.gz                 nl.1.gz         stat.1.gz
...             ...                       ...             ...

I would like, for example, to view the Bash man pages. I wrote a Dockerfile:

FROM lnl7/nix:latest

RUN nix-env --file '<nixpkgs>' --install --attr man

Building and running the above image interactively shows that the man pages are present in the nix store:

ls /nix/store/*-bash-interactive-*-man/share/man/man1
bash.1.gz  bashbug.1.gz

But the man page isn’t linked into the environment:

man bash
No manual entry for bash
ls /run/current-system/sw/share/man/man1 | grep bash || echo nothing

I’ve tried several other packages (,, etc.) and had the same problem. Please help – what am I missing?

I think this is a known issue. It’s always good to get more visibility to it though! Here are a few open issues for it:

A potential fix:

1 Like

Thanks! It isn’t pretty, but this actually works:

FROM lnl7/nix:latest

RUN nix-env --file '<nixpkgs>' --install --attr man \
 && nix-env --install \
    $(nix-instantiate --no-gc-warning --expr ' \
        with import <nixpkgs> {};              \
        buildEnv {                             \
          name = "manpages-hack";              \
          paths = [                            \
          ];                                   \
          extraOutputsToInstall = [ "man" ];   \
        }'                                     \
1 Like