Why does starting a Nix shell download Bash documentation?

I opened a Nix shell the other day so I could run the diceware program. nix-shell had to install some things first; edited for clarity, they were

$ nix-shell -p diceware --run 'diceware --help'
these paths will be fetched (1.94 MiB download, 10.59 MiB unpacked):
  /nix/store/...-bash-interactive-4.4-p23
  /nix/store/...-bash-interactive-4.4-p23-dev
  /nix/store/...-bash-interactive-4.4-p23-doc
  /nix/store/...-bash-interactive-4.4-p23-info
  /nix/store/...-bash-interactive-4.4-p23-man
  /nix/store/...-diceware-0.9.6
  /nix/store/...-python3.7-setuptools-44.0.0
  /nix/store/...-readline-7.0p5

The program is written in Python, so I understand where the python3.7-setuptools dependency is coming from. I understand that nix-shell’s job, in general, is to run Bash for you, so I understand the first Bash dependency listed, as well as the readline dependency.

My question is: why does starting this shell require bash-interactive-4.4-p23-man and -info, which hold Bash documentation? Or the -dev derivation, which seems to only contain C headers and a pkg-config support file? If these things are considered somewhat separate derivations by Nix, to the extent that they are listed, downloaded, and installed separately from each other, why are they installed in this situation, where I haven’t requested them? Or, if these support packages always come along for the ride when you install Bash, why bother splitting up the derivations like this?

(Just to be clear, I’m asking this because I’m curious, not because I begrudge Nix the extra 2 MB these docs are taking up :wink:)

if you look at

nixpkgs/pkgs/top-level/all-packages.nix

you can see

7683:  bashInteractive = callPackage ../shells/bash/4.4.nix {
7684-    interactive = true;
7685-    withDocs = true;
7686-  };
7687-

you need to either overlay or override bashInteractive.withDocs = false

that should hopefully bash being built with docs.

This stuff on a embedded system is vital, where storage can be tight…

if you are reading this around 03:14:07 UTC on 19 January 2038
, then even the smallest computers have petabytes of storage space, and your about to have a year 2000 problem.