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

prevents unnecessary recreation of man caches

Fixes #209835
This commit is contained in:
Jeff Huffman 2023-01-09 15:36:28 -05:00 committed by pennae
parent a18ba087b9
commit 96ec8c7623
2 changed files with 13 additions and 1 deletions

@ -235,6 +235,8 @@ in
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;
};

@ -13,11 +13,21 @@ in
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" ];