This is one of those things that Unix newcomers in particular would probably benefit from, but not know to ask for. I posted about it originally over on the fediverse, but when I saw this category I realized it belongs here.
{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.man-pages ];
documentation = {
dev.enable = true;
man.generateCaches = true;
nixos.includeAllModules = true;
};
}
There’s a bunch of related options under documentation.*
that you can and should look up; I left out everything that defaults to on.
There are good reasons that these default to off - they use more disk space, and rebuilds take a bit longer - but for a machine that you use interactively it’s well worth it.
The man-pages package is easy to miss, because most programs install their own manpages regardless, so this package just has some very general system-wide stuff. You want that stuff, though! In my view, the importance of man intro
as a way to welcome first-timers can’t be overstated.
The generateCaches option is needed to make the apropos
and whatis
commands work properly. Again, one of those things where the people most in need of it may not even realize it’s supposed to work.
The rest of this is just about turning on docs for a few more things, on the principle that it’s better to have it whether or not you need it.
Another thing you can and should do is type nixos-help
and see if you’re satisfied with what it does. It should open the NixOS manual in a browser - which one will depend on a lot of stuff. If you’re not, you may need to set $BROWSER
in your shell config. If you want it to ignore the GUI and work entirely in a terminal, install w3m
and set BROWSER=w3m
. I realize it may be a bit quixotic of me to imagine that anyone younger than me wants that, but hey.