1let
2 pkgs = import ./.. { };
3 lib = pkgs.lib;
4in
5pkgs.stdenv.mkDerivation {
6 name = "nixpkgs-manual";
7
8 buildInputs = with pkgs; [ pandoc libxml2 libxslt zip jing xmlformat ];
9
10 src = ./.;
11
12 # Hacking on these variables? Make sure to close and open
13 # nix-shell between each test, maybe even:
14 # $ nix-shell --run "make clean all"
15 # otherwise they won't reapply :)
16 HIGHLIGHTJS = pkgs.documentation-highlighter;
17 XSL = "${pkgs.docbook_xsl_ns}/xml/xsl";
18 RNG = "${pkgs.docbook5}/xml/rng/docbook/docbook.rng";
19 XMLFORMAT_CONFIG = ../nixos/doc/xmlformat.conf;
20 xsltFlags = lib.concatStringsSep " " [
21 "--param section.autolabel 1"
22 "--param section.label.includes.component.label 1"
23 "--stringparam html.stylesheet 'style.css overrides.css highlightjs/mono-blue.css'"
24 "--stringparam html.script './highlightjs/highlight.pack.js ./highlightjs/loader.js'"
25 "--param xref.with.number.and.title 1"
26 "--param toc.section.depth 3"
27 "--stringparam admon.style ''"
28 "--stringparam callout.graphics.extension .svg"
29 ];
30
31 postPatch = ''
32 echo ${lib.version} > .version
33 '';
34
35 installPhase = ''
36 dest="$out/share/doc/nixpkgs"
37 mkdir -p "$(dirname "$dest")"
38 mv out/html "$dest"
39 mv "$dest/index.html" "$dest/manual.html"
40
41 mv out/epub/manual.epub "$dest/nixpkgs-manual.epub"
42
43 mkdir -p $out/nix-support/
44 echo "doc manual $dest manual.html" >> $out/nix-support/hydra-build-products
45 echo "doc manual $dest nixpkgs-manual.epub" >> $out/nix-support/hydra-build-products
46 '';
47}