2009-06-05 17:04:58 +02:00
|
|
|
{pkgs}:
|
2008-06-05 17:33:17 +02:00
|
|
|
|
2008-01-04 15:24:42 +01:00
|
|
|
let
|
|
|
|
|
2009-06-05 17:04:58 +02:00
|
|
|
manualConfig =
|
|
|
|
{ environment.checkConfigurationOptions = false;
|
|
|
|
};
|
2008-01-04 15:24:42 +01:00
|
|
|
|
|
|
|
options = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext
|
|
|
|
(builtins.toXML (pkgs.lib.optionAttrSetToDocList ""
|
2009-06-05 17:04:58 +02:00
|
|
|
(import ../../lib/eval-config.nix {inherit pkgs; configuration = manualConfig;}).optionDeclarations)));
|
2008-01-04 15:24:42 +01:00
|
|
|
|
|
|
|
optionsDocBook = pkgs.runCommand "options-db.xml" {} ''
|
|
|
|
${pkgs.libxslt}/bin/xsltproc -o $out ${./options-to-docbook.xsl} ${options}
|
|
|
|
'';
|
|
|
|
|
|
|
|
manual = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "nixos-manual";
|
|
|
|
|
|
|
|
sources = pkgs.lib.sourceFilesBySuffices ./. [".xml"];
|
|
|
|
|
|
|
|
buildInputs = [pkgs.libxslt];
|
|
|
|
|
|
|
|
xsltFlags = ''
|
|
|
|
--param section.autolabel 1
|
|
|
|
--param section.label.includes.component.label 1
|
|
|
|
--param html.stylesheet 'style.css'
|
|
|
|
--param xref.with.number.and.title 1
|
|
|
|
--param toc.section.depth 3
|
|
|
|
--param admon.style '''
|
|
|
|
--param callout.graphics.extension '.gif'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildCommand = ''
|
|
|
|
ensureDir $out
|
|
|
|
ln -s $sources/*.xml .
|
|
|
|
ln -s ${optionsDocBook} options-db.xml
|
|
|
|
xsltproc $xsltFlags --nonet --xinclude \
|
|
|
|
--output $out/manual.html \
|
|
|
|
${pkgs.docbook5_xsl}/xml/xsl/docbook/html/docbook.xsl \
|
|
|
|
./manual.xml
|
|
|
|
cp ${./style.css} $out/style.css
|
2008-12-17 14:25:23 +01:00
|
|
|
ensureDir $out/nix-support
|
2009-03-06 14:53:19 +01:00
|
|
|
echo "doc manual $out manual.html" >> $out/nix-support/hydra-build-products
|
2008-01-04 15:24:42 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in manual
|