docs: hide _module.* from NixOS/nix-darwin docs

These are already documented in the system-level manuals and have no
particular relevance to the `home-manager.*` options.
This commit is contained in:
Emily 2023-07-19 21:38:38 +01:00
parent 44ba018437
commit c707d4f552

View file

@ -46,9 +46,13 @@ let
hmPath = toString ./..; hmPath = toString ./..;
buildOptionsDocs = args@{ modules, ... }: buildOptionsDocs = args@{ modules, includeModuleSystemOptions ? true, ... }:
pkgs.buildPackages.nixosOptionsDoc ({ let options = (lib.evalModules { inherit modules; }).options;
options = (lib.evalModules { inherit modules; }).options; in pkgs.buildPackages.nixosOptionsDoc ({
options = if includeModuleSystemOptions then
options
else
builtins.removeAttrs options [ "_module" ];
transformOptions = opt: transformOptions = opt:
opt // { opt // {
# Clean up declaration sites to not refer to the Home Manager # Clean up declaration sites to not refer to the Home Manager
@ -64,7 +68,7 @@ let
else else
decl) opt.declarations; decl) opt.declarations;
}; };
} // builtins.removeAttrs args [ "modules" ]); } // builtins.removeAttrs args [ "modules" "includeModuleSystemOptions" ]);
hmOptionsDocs = buildOptionsDocs { hmOptionsDocs = buildOptionsDocs {
modules = import ../modules/modules.nix { modules = import ../modules/modules.nix {
@ -76,12 +80,14 @@ let
nixosOptionsDocs = buildOptionsDocs { nixosOptionsDocs = buildOptionsDocs {
modules = [ ../nixos scrubbedPkgsModule dontCheckDefinitions ]; modules = [ ../nixos scrubbedPkgsModule dontCheckDefinitions ];
includeModuleSystemOptions = false;
variablelistId = "nixos-options"; variablelistId = "nixos-options";
optionIdPrefix = "nixos-opt-"; optionIdPrefix = "nixos-opt-";
}; };
nixDarwinOptionsDocs = buildOptionsDocs { nixDarwinOptionsDocs = buildOptionsDocs {
modules = [ ../nix-darwin scrubbedPkgsModule dontCheckDefinitions ]; modules = [ ../nix-darwin scrubbedPkgsModule dontCheckDefinitions ];
includeModuleSystemOptions = false;
variablelistId = "nix-darwin-options"; variablelistId = "nix-darwin-options";
optionIdPrefix = "nix-darwin-opt-"; optionIdPrefix = "nix-darwin-opt-";
}; };