manual: automatically generate modules entries

This commit is contained in:
Eric Sagnes 2016-04-27 21:29:33 +09:00
parent 38f322f2cf
commit 898435d16e
4 changed files with 14 additions and 9 deletions

View File

@ -25,14 +25,10 @@ effect after you run <command>nixos-rebuild</command>.</para>
<xi:include href="linux-kernel.xml" /> <xi:include href="linux-kernel.xml" />
<xi:include href="grsecurity.xml" /> <xi:include href="grsecurity.xml" />
<!-- FIXME: auto-include NixOS module docs -->
<xi:include href="postgresql.xml" />
<xi:include href="gitlab.xml" />
<xi:include href="taskserver.xml" />
<xi:include href="acme.xml" />
<xi:include href="input-methods.xml" />
<xi:include href="emacs.xml" /> <xi:include href="emacs.xml" />
<xi:include href="modules.xml" xpointer="xpointer(//section[@id='modules']/*)" />
<!-- Apache; libvirtd virtualisation --> <!-- Apache; libvirtd virtualisation -->
</part> </part>

View File

@ -1,4 +1,4 @@
{ pkgs, options, version, revision, extraSources ? [] }: { pkgs, options, config, version, revision, extraSources ? [] }:
with pkgs; with pkgs;
@ -51,6 +51,14 @@ let
sources = lib.sourceFilesBySuffices ./. [".xml"]; sources = lib.sourceFilesBySuffices ./. [".xml"];
modulesDoc = builtins.toFile "modules.xml" ''
<section xmlns:xi="http://www.w3.org/2001/XInclude" id="modules">
${(lib.concatMapStrings (path: ''
<xi:include href="${path}" />
'') (lib.catAttrs "value" config.meta.doc))}
</section>
'';
copySources = copySources =
'' ''
cp -prd $sources/* . # */ cp -prd $sources/* . # */
@ -61,6 +69,7 @@ let
cp ${../../modules/security/acme.xml} configuration/acme.xml cp ${../../modules/security/acme.xml} configuration/acme.xml
cp ${../../modules/i18n/input-method/default.xml} configuration/input-methods.xml cp ${../../modules/i18n/input-method/default.xml} configuration/input-methods.xml
cp ${../../modules/services/editors/emacs.xml} configuration/emacs.xml cp ${../../modules/services/editors/emacs.xml} configuration/emacs.xml
ln -s ${modulesDoc} configuration/modules.xml
ln -s ${optionsDocBook} options-db.xml ln -s ${optionsDocBook} options-db.xml
echo "${version}" > version echo "${version}" > version
''; '';

View File

@ -17,7 +17,7 @@ let
Caveat: even if the package is reached by a different means, Caveat: even if the package is reached by a different means,
the path above will be shown and not e.g. `${config.services.foo.package}`. */ the path above will be shown and not e.g. `${config.services.foo.package}`. */
manual = import ../../../doc/manual { manual = import ../../../doc/manual {
inherit pkgs; inherit pkgs config;
version = config.system.nixosRelease; version = config.system.nixosRelease;
revision = "release-${config.system.nixosRelease}"; revision = "release-${config.system.nixosRelease}";
options = options =

View File

@ -534,6 +534,6 @@ in {
(mkIf (cfg.enable && cfg.listenHost != "localhost") { (mkIf (cfg.enable && cfg.listenHost != "localhost") {
networking.firewall.allowedTCPPorts = [ cfg.listenPort ]; networking.firewall.allowedTCPPorts = [ cfg.listenPort ];
}) })
{ meta.doc = ./taskserver.xml; } { meta.doc = ./doc.xml; }
]; ];
} }