liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

doc.nix (1240B)


      1 { stdenv,
      2   lib,
      3   liminix,
      4   gnumake,
      5   fennel,
      6   pandoc,
      7   luaPackages,
      8   asciidoctor,
      9   borderVmConf
     10 }:
     11 let
     12   json =
     13     (import liminix {
     14       inherit borderVmConf;
     15       device = import (liminix + "/devices/qemu");
     16       liminix-config =
     17         { ... }:
     18         {
     19           imports = [ ./modules/all-modules.nix ];
     20         };
     21     }).outputs.optionsJson;
     22 in
     23 stdenv.mkDerivation {
     24   name = "liminix-doc";
     25   nativeBuildInputs = [
     26     gnumake
     27     fennel
     28     pandoc
     29     asciidoctor
     30     luaPackages.lyaml
     31   ];
     32 
     33   src = lib.sources.sourceFilesBySuffices
     34     (lib.cleanSource ./. ) [
     35       ".adoc"
     36       ".nix" ".rst" "Makefile" ".svg"
     37       ".fnl" ".py" ".css" ".html"
     38       ".md" ".html.in"
     39     ];
     40 
     41   buildPhase = ''
     42     cat ${json} | fennel --correlate doc/parse-options.fnl > doc/module-options-generated.inc.rst
     43     cat ${json} | fennel --correlate doc/parse-options-outputs.fnl     > doc/outputs-generated.inc.rst
     44     cp ${(import ./doc/hardware.nix)} doc/hardware.rst
     45     make -C doc html
     46   '';
     47   installPhase = ''
     48     mkdir -p $out/nix-support
     49     cd doc
     50     make install prefix=$out
     51     ln -s ${json} $out/options.json
     52     echo "file source-dist \"$out/share/doc/liminix\"" \
     53         > $out/nix-support/hydra-build-products
     54   '';
     55 }