1{ pkgs ? (import ./.. { }), nixpkgs ? { }}:
2let
3 doc-support = import ./doc-support { inherit pkgs nixpkgs; };
4in pkgs.stdenv.mkDerivation {
5 name = "nixpkgs-manual";
6
7 nativeBuildInputs = with pkgs; [
8 pandoc
9 graphviz
10 libxml2
11 libxslt
12 zip
13 jing
14 xmlformat
15 ];
16
17 src = pkgs.nix-gitignore.gitignoreSource [] ./.;
18
19 postPatch = ''
20 ln -s ${doc-support} ./doc-support/result
21 '';
22
23 preBuild = ''
24 make -j$NIX_BUILD_CORES render-md
25 '';
26
27 installPhase = ''
28 dest="$out/share/doc/nixpkgs"
29 mkdir -p "$(dirname "$dest")"
30 mv out/html "$dest"
31 mv "$dest/index.html" "$dest/manual.html"
32
33 mv out/epub/manual.epub "$dest/nixpkgs-manual.epub"
34
35 mkdir -p $out/nix-support/
36 echo "doc manual $dest manual.html" >> $out/nix-support/hydra-build-products
37 echo "doc manual $dest nixpkgs-manual.epub" >> $out/nix-support/hydra-build-products
38 '';
39
40 # Environment variables
41 PANDOC_LUA_FILTERS_DIR = "${pkgs.pandoc-lua-filters}/share/pandoc/filters";
42 PANDOC_LINK_MANPAGES_FILTER = import build-aux/pandoc-filters/link-manpages.nix { inherit pkgs; };
43}