···
138
+
prepareManualFromMD = ''
139
+
cp -r --no-preserve=all $inputs/* .
141
+
substituteInPlace ./manual.md \
142
+
--replace '@NIXOS_VERSION@' "${version}"
143
+
substituteInPlace ./configuration/configuration.md \
145
+
'@MODULE_CHAPTERS@' \
146
+
${lib.escapeShellArg (lib.concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)}
147
+
substituteInPlace ./nixos-options.md \
149
+
'@NIXOS_OPTIONS_JSON@' \
150
+
${optionsDoc.optionsJSON}/share/doc/nixos/options.json
151
+
substituteInPlace ./development/writing-nixos-tests.section.md \
153
+
'@NIXOS_TEST_OPTIONS_JSON@' \
154
+
${testOptionsDoc.optionsJSON}/share/doc/nixos/options.json
manual-combined = runCommand "nixos-manual-combined"
{ inputs = lib.sourceFilesBySuffices ./. [ ".xml" ".md" ];
nativeBuildInputs = [ pkgs.nixos-render-docs pkgs.libxml2.bin pkgs.libxslt.bin ];
meta.description = "The NixOS manual as plain docbook XML";
144
-
cp -r --no-preserve=all $inputs/* .
146
-
substituteInPlace ./manual.md \
147
-
--replace '@NIXOS_VERSION@' "${version}"
148
-
substituteInPlace ./configuration/configuration.md \
150
-
'@MODULE_CHAPTERS@' \
151
-
${lib.escapeShellArg (lib.concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)}
152
-
substituteInPlace ./nixos-options.md \
154
-
'@NIXOS_OPTIONS_JSON@' \
155
-
${optionsDoc.optionsJSON}/share/doc/nixos/options.json
156
-
substituteInPlace ./development/writing-nixos-tests.section.md \
158
-
'@NIXOS_TEST_OPTIONS_JSON@' \
159
-
${testOptionsDoc.optionsJSON}/share/doc/nixos/options.json
163
+
${prepareManualFromMD}
nixos-render-docs -j $NIX_BUILD_CORES manual docbook \
--manpage-urls ${manpageUrls} \
···
# Generate the NixOS manual.
manualHTML = runCommand "nixos-manual-html"
196
-
{ nativeBuildInputs = [ buildPackages.libxml2.bin buildPackages.libxslt.bin ];
200
+
{ nativeBuildInputs =
201
+
if allowDocBook then [
202
+
buildPackages.libxml2.bin
203
+
buildPackages.libxslt.bin
205
+
buildPackages.nixos-render-docs
207
+
inputs = lib.optionals (! allowDocBook) (lib.sourceFilesBySuffices ./. [ ".md" ]);
meta.description = "The NixOS manual in HTML format";
allowedReferences = ["out"];
···
# Generate the HTML manual.
205
-
${manualXsltprocOptions} \
206
-
--stringparam id.warnings "1" \
207
-
--nonet --output $dst/ \
208
-
${docbook_xsl_ns}/xml/xsl/docbook/xhtml/chunktoc.xsl \
209
-
${manual-combined}/manual-combined.xml \
210
-
|& tee xsltproc.out
211
-
grep "^ID recommended on" xsltproc.out &>/dev/null && echo "error: some IDs are missing" && false
214
-
mkdir -p $dst/images/callouts
215
-
cp ${docbook_xsl_ns}/xml/xsl/docbook/images/callouts/*.svg $dst/images/callouts/
cp ${../../../doc/style.css} $dst/style.css
cp ${../../../doc/overrides.css} $dst/overrides.css
cp -r ${pkgs.documentation-highlighter} $dst/highlightjs
220
+
${if allowDocBook then ''
222
+
${manualXsltprocOptions} \
223
+
--stringparam id.warnings "1" \
224
+
--nonet --output $dst/ \
225
+
${docbook_xsl_ns}/xml/xsl/docbook/xhtml/chunktoc.xsl \
226
+
${manual-combined}/manual-combined.xml \
227
+
|& tee xsltproc.out
228
+
grep "^ID recommended on" xsltproc.out &>/dev/null && echo "error: some IDs are missing" && false
231
+
mkdir -p $dst/images/callouts
232
+
cp ${docbook_xsl_ns}/xml/xsl/docbook/images/callouts/*.svg $dst/images/callouts/
234
+
${prepareManualFromMD}
236
+
# TODO generator is set like this because the docbook/md manual compare workflow will
237
+
# trigger if it's different
238
+
nixos-render-docs -j $NIX_BUILD_CORES manual html \
239
+
--manpage-urls ${manpageUrls} \
240
+
--revision ${lib.escapeShellArg revision} \
241
+
--generator "DocBook XSL Stylesheets V${docbook_xsl_ns.version}" \
242
+
--stylesheet style.css \
243
+
--stylesheet overrides.css \
244
+
--stylesheet highlightjs/mono-blue.css \
245
+
--script ./highlightjs/highlight.pack.js \
246
+
--script ./highlightjs/loader.js \
248
+
--chunk-toc-depth 1 \
mkdir -p $out/nix-support
echo "nix-build out $out" >> $out/nix-support/hydra-build-products