nixos docs: Add a makefile for hacking on the nixos docs

This commit is contained in:
Graham Christensen 2018-04-28 04:00:55 -04:00
parent 59f8b1e844
commit 0ff0d138e4
No known key found for this signature in database
GPG Key ID: ACA1C1D120C83D5C
5 changed files with 16 additions and 6 deletions

View File

@ -0,0 +1,8 @@
debug:
nix-shell --packages xmloscopy \
--run 'xmloscopy --docbook5 ./manual.xml ./manual-combined.xml'
generated: ./options-to-docbook.xsl
nix-build ../../release.nix \
--attr manualGeneratedSources.x86_64-linux \
--out-link ./generated

View File

@ -229,6 +229,7 @@ let
'';
in rec {
inherit generatedSources;
# The NixOS options in JSON format.
optionsJSON = runCommand "options-json"

View File

@ -39,7 +39,8 @@
<appendix xml:id="ch-options">
<title>Configuration Options</title>
<xi:include href="./generated/options-db.xml" />
<xi:include href="./generated/options-db.xml"
xpointer="configuration-variable-list" />
</appendix>
<xi:include href="release-notes/release-notes.xml" />

View File

@ -15,9 +15,9 @@
<xsl:template match="/expr/list">
<variablelist>
<appendix>
<title>Configuration Options</title>
<variablelist xml:id="configuration-variable-list">
<xsl:for-each select="attrs">
<xsl:variable name="id" select="concat('opt-', str:replace(str:replace(str:replace(str:replace(attr[@name = 'name']/string/@value, '*', '_'), '&lt;', '_'), '>', '_'), '?', '_'))" />
<varlistentry>
@ -100,7 +100,7 @@
</xsl:for-each>
</variablelist>
</appendix>
</xsl:template>

View File

@ -124,7 +124,6 @@ let
preferLocalBuild = true;
};
in rec {
channel = import lib/make-channel.nix { inherit pkgs nixpkgs version versionSuffix; };
@ -132,6 +131,7 @@ in rec {
manual = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manual);
manualEpub = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manualEpub));
manpages = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manpages);
manualGeneratedSources = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.generatedSources);
options = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux;