docs: NixOS and nix-darwin option documentation

This commit is contained in:
Robert Helgesson 2021-01-18 23:21:32 +01:00
parent c33b1777b6
commit 5280360d6c
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 73 additions and 8 deletions

View file

@ -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 { modules = import ../modules/modules.nix {
inherit lib pkgs; inherit lib pkgs;
check = false; check = false;
} ++ [ scrubbedPkgsModule ]; } ++ [ scrubbedPkgsModule ];
moduleRootPaths = [ ./.. ];
mkModuleUrl = path:
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
channelName = "home-manager";
docBook.id = "home-manager-options"; 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 { docs = nmd.buildDocBookDocs {
pathName = "home-manager"; pathName = "home-manager";
modulesDocs = [ hmModulesDocs ]; modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
documentsDirectory = ./.; documentsDirectory = ./.;
documentType = "book"; documentType = "book";
chunkToc = '' chunkToc = ''
<toc> <toc>
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?> <d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry> <d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
<d:tocentry linkend="ch-nixos-options"><?dbhtml filename="nixos-options.html"?></d:tocentry>
<d:tocentry linkend="ch-nix-darwin-options"><?dbhtml filename="nix-darwin-options.html"?></d:tocentry>
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry> <d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry> <d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
</d:tocentry> </d:tocentry>

View file

@ -38,6 +38,14 @@
<title>Configuration Options</title> <title>Configuration Options</title>
<xi:include href="./nmd-result/home-manager-options.xml" /> <xi:include href="./nmd-result/home-manager-options.xml" />
</appendix> </appendix>
<appendix xml:id="ch-nixos-options">
<title>NixOS Module Options</title>
<xi:include href="./nmd-result/nixos-options.xml" />
</appendix>
<appendix xml:id="ch-nix-darwin-options">
<title>nix-darwin Module Options</title>
<xi:include href="./nmd-result/nix-darwin-options.xml" />
</appendix>
<appendix xml:id="ch-tools"> <appendix xml:id="ch-tools">
<title>Tools</title> <title>Tools</title>
<xi:include href="./man-home-manager.xml" /> <xi:include href="./man-home-manager.xml" />

View file

@ -36,7 +36,7 @@ in
home-manager = { home-manager = {
useUserPackages = mkEnableOption '' useUserPackages = mkEnableOption ''
installation of user packages through the installation of user packages through the
<option>users.users.name?.packages</option> option. <option>users.users.&lt;name?&gt;.packages</option> option.
''; '';
useGlobalPkgs = mkEnableOption '' useGlobalPkgs = mkEnableOption ''
@ -60,6 +60,9 @@ in
users = mkOption { users = mkOption {
type = types.attrsOf hmModule; type = types.attrsOf hmModule;
default = {}; default = {};
# Set as not visible to prevent the entire submodule being included in
# the documentation.
visible = false;
description = '' description = ''
Per-user Home Manager configuration. Per-user Home Manager configuration.
''; '';

View file

@ -46,7 +46,7 @@ in {
home-manager = { home-manager = {
useUserPackages = mkEnableOption '' useUserPackages = mkEnableOption ''
installation of user packages through the installation of user packages through the
<option>users.users.name?.packages</option> option. <option>users.users.&lt;name&gt;.packages</option> option.
''; '';
useGlobalPkgs = mkEnableOption '' useGlobalPkgs = mkEnableOption ''
@ -70,6 +70,9 @@ in {
users = mkOption { users = mkOption {
type = types.attrsOf hmModule; type = types.attrsOf hmModule;
default = { }; default = { };
# Set as not visible to prevent the entire submodule being included in
# the documentation.
visible = false;
description = '' description = ''
Per-user Home Manager configuration. Per-user Home Manager configuration.
''; '';