Why devShell sometimes lose packages' man pages?

Why shellcheck has no man pages when made available via nix develop but has a man page with nix shell nixpkgs#shellcheck?

I have this flake.nix:

  description = "A shell with stuff";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
        pkgs = import nixpkgs { inherit system; };
      rec {
        devShell = pkgs.mkShell rec {
          packages = with pkgs; [

And it works. But no man pages:

$ nix develop
warning: creating lock file '/tmp/test/flake.lock'

[h@desk03:/tmp/test]$ type shellcheck
shellcheck is /nix/store/8mpr0bjwmxli1hfjxap092hvb9r6vfzs-shellcheck-0.9.0-bin/bin/shellcheck

[h@desk03:/tmp/test]$ man shellcheck
No manual entry for shellcheck

[h@desk03:/tmp/test]$ manpath

But I do get my loved man pages via nix shell:

$ nix shell nixpkgs#shellcheck

[h@desk03:/tmp/test]$ type shellcheck
shellcheck is /nix/store/8mpr0bjwmxli1hfjxap092hvb9r6vfzs-shellcheck-0.9.0-bin/bin/shellcheck

[h@desk03:/tmp/test]$ man shellcheck
# I see the manpage

[h@desk03:/tmp/test]$ manpath

[h@desk03:/tmp/test]$ file /nix/store/k6n4dgjv8cxhhvsvhlf7l0m2s5azg8v5-shellcheck-0.9.0-man/share/man/man1/shellcheck.1.gz
/nix/store/k6n4dgjv8cxhhvsvhlf7l0m2s5azg8v5-shellcheck-0.9.0-man/share/man/man1/shellcheck.1.gz: gzip compressed data, from Unix, original size modulo 2^32 14750

But the weirder thing is: I get man pages in nix develop for other packages! If I add nmap to the Flake file above, I can read man nmap fine via nix develop and also via nix shell nixpkgs#nmap.

Why I’m losing parts of some packages in a devShell/nix develop? Is this a known caveat in devShells? Or is it a bug in my Flake file? Are there other parts of packages that also “disappear” if using nix shell or nix develop?

I’m new to all of this, but I thought I would get the same package regardless of how I “installed” it?

1 Like

Sometimes putting stuff in buildInputs instead of packages (as given to mkShell) works better. I have no idea why it what the difference is under the hood.