1# Generates the documentation for library functons via nixdoc. To add
2# another library function file to this list, the include list in the
3# file `doc/functions/library.xml` must also be updated.
4
5{ pkgs ? import ./.. {}, locationsXml }:
6
7with pkgs; stdenv.mkDerivation {
8 name = "nixpkgs-lib-docs";
9 src = ./../../lib;
10
11 buildInputs = [ nixdoc ];
12 installPhase = ''
13 function docgen {
14 nixdoc -c "$1" -d "$2" -f "../lib/$1.nix" > "$out/$1.xml"
15 }
16
17 mkdir -p $out
18 ln -s ${locationsXml} $out/locations.xml
19
20 docgen strings 'String manipulation functions'
21 docgen trivial 'Miscellaneous functions'
22 docgen lists 'List manipulation functions'
23 docgen debug 'Debugging functions'
24 docgen options 'NixOS / nixpkgs option handling'
25 docgen filesystem 'Filesystem functions'
26 docgen sources 'Source filtering functions'
27 '';
28}