summaryrefslogtreecommitdiff
path: root/docs/.nix/derivation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'docs/.nix/derivation.nix')
-rw-r--r--docs/.nix/derivation.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/.nix/derivation.nix b/docs/.nix/derivation.nix
new file mode 100644
index 0000000..9780f52
--- /dev/null
+++ b/docs/.nix/derivation.nix
@@ -0,0 +1,37 @@
+{ lib
+, stdenvNoCC
+, python3
+, python3Packages
+, doxygen
+, gasp
+, version
+}:
+
+stdenvNoCC.mkDerivation {
+ pname = "forstio-docs";
+ inherit version;
+
+ src = ../../.;
+
+ nativeBuildInputs = [
+ python3
+ python3Packages.sphinx
+ python3Packages.sphinx-rtd-theme
+ doxygen
+ gasp
+ ];
+
+ buildPhase = ''
+ # C++ API generation
+ doxygen docs/Doxygen.in
+ python3 ${gasp.outPath}/bin/gasp.py xml --namespace duke > cpp_map.json
+ # C++ and C template generation
+ python3 ${gasp.outPath}/bin/make_rst.py --title="C++" -t ${gasp.outPath}/templates/rst -m cpp_map.json -o source/cpp_api
+ make html
+ '';
+
+ installPhase = ''
+ mkdir -p $out
+ mv build/html $out/html
+ '';
+}