lol

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

prevents unnecessary recreation of man caches

Fixes #209835

authored by

Jeff Huffman and committed by
pennae
96ec8c76 a18ba087

+13 -1
+2
nixos/modules/installer/tools/tools.nix
··· 235 235 nixos-enter 236 236 ] ++ lib.optional (nixos-option != null) nixos-option; 237 237 238 + documentation.man.man-db.skipPackages = [ nixos-version ]; 239 + 238 240 system.build = { 239 241 inherit nixos-install nixos-generate-config nixos-option nixos-rebuild nixos-enter; 240 242 };
+11 -1
nixos/modules/misc/man-db.nix
··· 13 13 example = false; 14 14 }; 15 15 16 + skipPackages = lib.mkOption { 17 + type = lib.types.listOf lib.types.package; 18 + default = []; 19 + internal = true; 20 + description = lib.mdDoc '' 21 + Packages to *not* include in the man-db. 22 + This can be useful to avoid unnecessary rebuilds due to packages that change frequently, like nixos-version. 23 + ''; 24 + }; 25 + 16 26 manualPages = lib.mkOption { 17 27 type = lib.types.path; 18 28 default = pkgs.buildEnv { 19 29 name = "man-paths"; 20 - paths = config.environment.systemPackages; 30 + paths = lib.subtractLists cfg.skipPackages config.environment.systemPackages; 21 31 pathsToLink = [ "/share/man" ]; 22 32 extraOutputsToInstall = [ "man" ] 23 33 ++ lib.optionals config.documentation.dev.enable [ "devman" ];