nixos/documentation.man.mandb: Add skipPackages option, and include nixos-version

prevents unnecessary recreation of man caches

Fixes #209835

Changed files
+13 -1
nixos
modules
installer
tools
misc
+2
nixos/modules/installer/tools/tools.nix
···
nixos-enter
] ++ lib.optional (nixos-option != null) nixos-option;
+
documentation.man.man-db.skipPackages = [ nixos-version ];
+
system.build = {
inherit nixos-install nixos-generate-config nixos-option nixos-rebuild nixos-enter;
};
+11 -1
nixos/modules/misc/man-db.nix
···
example = false;
};
+
skipPackages = lib.mkOption {
+
type = lib.types.listOf lib.types.package;
+
default = [];
+
internal = true;
+
description = lib.mdDoc ''
+
Packages to *not* include in the man-db.
+
This can be useful to avoid unnecessary rebuilds due to packages that change frequently, like nixos-version.
+
'';
+
};
+
manualPages = lib.mkOption {
type = lib.types.path;
default = pkgs.buildEnv {
name = "man-paths";
-
paths = config.environment.systemPackages;
+
paths = lib.subtractLists cfg.skipPackages config.environment.systemPackages;
pathsToLink = [ "/share/man" ];
extraOutputsToInstall = [ "man" ]
++ lib.optionals config.documentation.dev.enable [ "devman" ];