diff --git a/doc/default.nix b/doc/default.nix index 6b8e229a..8015f1b5 100644 --- a/doc/default.nix +++ b/doc/default.nix @@ -26,27 +26,78 @@ let }]; }; - hmModulesDocs = nmd.buildModulesDocs { + buildModulesDocs = args: + nmd.buildModulesDocs ({ + moduleRootPaths = [ ./.. ]; + mkModuleUrl = path: + "https://github.com/nix-community/home-manager/blob/master/${path}#blob-path"; + channelName = "home-manager"; + } // args); + + hmModulesDocs = buildModulesDocs { modules = import ../modules/modules.nix { inherit lib pkgs; check = false; } ++ [ scrubbedPkgsModule ]; - moduleRootPaths = [ ./.. ]; - mkModuleUrl = path: - "https://github.com/nix-community/home-manager/blob/master/${path}#blob-path"; - channelName = "home-manager"; docBook.id = "home-manager-options"; }; + nixosModuleDocs = buildModulesDocs { + modules = let + nixosModule = module: pkgs.path + "/nixos/modules" + module; + mockedNixos = with lib; { + options = { + environment.pathsToLink = mkSinkUndeclaredOptions { }; + systemd.services = mkSinkUndeclaredOptions { }; + users.users = mkSinkUndeclaredOptions { }; + }; + }; + in [ + ../nixos/default.nix + mockedNixos + (nixosModule "/misc/assertions.nix") + scrubbedPkgsModule + ]; + docBook = { + id = "nixos-options"; + optionIdPrefix = "nixos-opt"; + }; + }; + + nixDarwinModuleDocs = buildModulesDocs { + modules = let + nixosModule = module: pkgs.path + "/nixos/modules" + module; + mockedNixDarwin = with lib; { + options = { + environment.pathsToLink = mkSinkUndeclaredOptions { }; + system.activationScripts.postActivation.text = + mkSinkUndeclaredOptions { }; + users.users = mkSinkUndeclaredOptions { }; + }; + }; + in [ + ../nix-darwin/default.nix + mockedNixDarwin + (nixosModule "/misc/assertions.nix") + scrubbedPkgsModule + ]; + docBook = { + id = "nix-darwin-options"; + optionIdPrefix = "nix-darwin-opt"; + }; + }; + docs = nmd.buildDocBookDocs { pathName = "home-manager"; - modulesDocs = [ hmModulesDocs ]; + modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ]; documentsDirectory = ./.; documentType = "book"; chunkToc = '' + + diff --git a/doc/manual.xml b/doc/manual.xml index 314d7c10..aa069c86 100644 --- a/doc/manual.xml +++ b/doc/manual.xml @@ -38,6 +38,14 @@ Configuration Options + + NixOS Module Options + + + + nix-darwin Module Options + + Tools diff --git a/nix-darwin/default.nix b/nix-darwin/default.nix index 12d02174..95669592 100644 --- a/nix-darwin/default.nix +++ b/nix-darwin/default.nix @@ -36,7 +36,7 @@ in home-manager = { useUserPackages = mkEnableOption '' installation of user packages through the - option. + option. ''; useGlobalPkgs = mkEnableOption '' @@ -60,6 +60,9 @@ in users = mkOption { type = types.attrsOf hmModule; default = {}; + # Set as not visible to prevent the entire submodule being included in + # the documentation. + visible = false; description = '' Per-user Home Manager configuration. ''; diff --git a/nixos/default.nix b/nixos/default.nix index e5ca61c0..6645b906 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -46,7 +46,7 @@ in { home-manager = { useUserPackages = mkEnableOption '' installation of user packages through the - option. + option. ''; useGlobalPkgs = mkEnableOption '' @@ -70,6 +70,9 @@ in { users = mkOption { type = types.attrsOf hmModule; default = { }; + # Set as not visible to prevent the entire submodule being included in + # the documentation. + visible = false; description = '' Per-user Home Manager configuration. '';