Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
nixos/documentation: add option to generate caches #86489
Motivation for this change
When using --with-config-file, all man-db programs completely ignore the systemwide configuration in /etc/man_db.conf: it means on NixOS there is no way to change the configuration without rebuilding man-db, which in turn causes a mass-rebuild. To solve this problem this commit removes the NixOS-specific configuration in man-db, which wasn't the appropriate place to begin with: the package is expected to work on non-NixOS systems as well. Also a small patch now ensure /etc/man_db.conf is used, if available, before the bundled configuration.
Previously the NixOS-specific configuration for man-db was in the package itself and /etc/man.conf was completely ignored. This change moves it to /etc/man_db.conf, making declarative configuration practical again. It's now possible to generate the mandb caches for all packages installed through NixOS `environment.systemPackages` at build-time. The standard location for the stateful cache (/var/cache/man) is also configured to allow users to run `mandb` manually if they wish. Since generating the cache can be expensive the option is off by default.