mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-31 04:04:32 +00:00
options-manual: Remove users
option set from documentation
The option declaration `users.users` is owned by the upstream nixos modules and should not be documented by home-manager. Home-manager declares an incomplete/partial option definition for `users.users` that cannot be documented without the full definition from the nixos modules. This partial definition is removed from the options set while generating documentation for the home-manager nixos module.
This commit is contained in:
parent
aec4ee4c1a
commit
319b012b9d
1 changed files with 12 additions and 6 deletions
|
@ -54,17 +54,17 @@ let
|
||||||
|
|
||||||
hmPath = toString ./..;
|
hmPath = toString ./..;
|
||||||
|
|
||||||
buildOptionsDocs = args@{ modules, includeModuleSystemOptions ? true, ... }:
|
buildOptionsDocs =
|
||||||
|
args@{ modules, includeModuleSystemOptions ? true, isNixos ? false, ... }:
|
||||||
let
|
let
|
||||||
options = (lib.evalModules {
|
options = (lib.evalModules {
|
||||||
inherit modules;
|
inherit modules;
|
||||||
class = "homeManager";
|
class = "homeManager";
|
||||||
}).options;
|
}).options;
|
||||||
in pkgs.buildPackages.nixosOptionsDoc ({
|
in pkgs.buildPackages.nixosOptionsDoc ({
|
||||||
options = if includeModuleSystemOptions then
|
options = builtins.removeAttrs options ([ ]
|
||||||
options
|
++ (lib.optional (!includeModuleSystemOptions) "_module")
|
||||||
else
|
++ (lib.optional (isNixos) "users"));
|
||||||
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
|
||||||
|
@ -80,7 +80,11 @@ let
|
||||||
else
|
else
|
||||||
decl) opt.declarations;
|
decl) opt.declarations;
|
||||||
};
|
};
|
||||||
} // builtins.removeAttrs args [ "modules" "includeModuleSystemOptions" ]);
|
} // builtins.removeAttrs args [
|
||||||
|
"modules"
|
||||||
|
"includeModuleSystemOptions"
|
||||||
|
"isNixos"
|
||||||
|
]);
|
||||||
|
|
||||||
hmOptionsDocs = buildOptionsDocs {
|
hmOptionsDocs = buildOptionsDocs {
|
||||||
modules = import ../modules/modules.nix {
|
modules = import ../modules/modules.nix {
|
||||||
|
@ -93,6 +97,7 @@ let
|
||||||
nixosOptionsDocs = buildOptionsDocs {
|
nixosOptionsDocs = buildOptionsDocs {
|
||||||
modules = [ ../nixos scrubbedPkgsModule dontCheckDefinitions ];
|
modules = [ ../nixos scrubbedPkgsModule dontCheckDefinitions ];
|
||||||
includeModuleSystemOptions = false;
|
includeModuleSystemOptions = false;
|
||||||
|
isNixos = true;
|
||||||
variablelistId = "nixos-options";
|
variablelistId = "nixos-options";
|
||||||
optionIdPrefix = "nixos-opt-";
|
optionIdPrefix = "nixos-opt-";
|
||||||
};
|
};
|
||||||
|
@ -100,6 +105,7 @@ let
|
||||||
nixDarwinOptionsDocs = buildOptionsDocs {
|
nixDarwinOptionsDocs = buildOptionsDocs {
|
||||||
modules = [ ../nix-darwin scrubbedPkgsModule dontCheckDefinitions ];
|
modules = [ ../nix-darwin scrubbedPkgsModule dontCheckDefinitions ];
|
||||||
includeModuleSystemOptions = false;
|
includeModuleSystemOptions = false;
|
||||||
|
isNixos = true;
|
||||||
variablelistId = "nix-darwin-options";
|
variablelistId = "nix-darwin-options";
|
||||||
optionIdPrefix = "nix-darwin-opt-";
|
optionIdPrefix = "nix-darwin-opt-";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue