2
0
Files
liminix/doc.nix
T

63 lines
1.2 KiB
Nix
Raw Normal View History

2025-11-11 21:49:45 +00:00
{
stdenv,
2025-04-06 18:01:33 +01:00
lib,
liminix,
gnumake,
pandoc,
luaPackages,
asciidoctor,
2025-11-11 21:49:45 +00:00
borderVmConf,
2025-04-06 18:01:33 +01:00
}:
let
2026-03-07 23:03:43 +00:00
fennel = luaPackages.fennel;
2025-04-06 18:01:33 +01:00
json =
(import liminix {
inherit borderVmConf;
device = import (liminix + "/devices/qemu");
liminix-config =
{ ... }:
{
imports = [ ./modules/all-modules.nix ];
};
}).outputs.optionsJson;
in
stdenv.mkDerivation {
name = "liminix-doc";
nativeBuildInputs = [
gnumake
fennel
pandoc
asciidoctor
luaPackages.lyaml
];
2025-11-11 21:49:45 +00:00
src = lib.sources.sourceFilesBySuffices (lib.cleanSource ./.) [
".adoc"
".nix"
".rst"
"Makefile"
".svg"
".fnl"
".py"
".css"
".html"
".md"
".html.in"
];
2025-04-06 18:01:33 +01:00
buildPhase = ''
cat ${json} | fennel --correlate doc/parse-options.fnl > doc/module-options-generated.inc.rst
2025-04-06 18:01:33 +01:00
cat ${json} | fennel --correlate doc/parse-options-outputs.fnl > doc/outputs-generated.inc.rst
2025-09-18 21:58:26 +01:00
cp ${(import ./doc/hardware.nix)} doc/hardware.adoc
2025-04-06 18:01:33 +01:00
make -C doc html
'';
installPhase = ''
2025-04-10 00:22:29 +01:00
mkdir -p $out/nix-support
2025-04-06 18:01:33 +01:00
cd doc
2025-04-10 00:22:29 +01:00
make install prefix=$out
2025-04-06 18:01:33 +01:00
ln -s ${json} $out/options.json
echo "file source-dist \"$out/share/doc/liminix\"" \
> $out/nix-support/hydra-build-products
'';
}