2019-11-06 23:15:43 +03:00
|
|
|
{
|
|
|
|
pkgs ? import ./pkgs.nix
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2019-11-09 03:36:05 +03:00
|
|
|
inherit (pkgs) stdenv mobile-nixos-process-doc rsync;
|
2019-11-06 23:15:43 +03:00
|
|
|
|
|
|
|
# Styles, built from a preprocessor.
|
|
|
|
styles = pkgs.callPackage ./_support/styles { };
|
|
|
|
|
|
|
|
# Asciidoc source for the devices section.
|
|
|
|
devices = pkgs.callPackage ./_support/devices { };
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "mobile-nixos-docs";
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
mobile-nixos-process-doc
|
2019-11-09 03:36:05 +03:00
|
|
|
rsync
|
2019-11-06 23:15:43 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
# Removes the internal notes.
|
|
|
|
rm -f README.md
|
|
|
|
|
|
|
|
# Replace it in-place with the repo README.
|
2019-11-12 00:46:05 +03:00
|
|
|
cat >> README.adoc <<EOF
|
|
|
|
README.adoc
|
|
|
|
===========
|
2019-11-06 23:15:43 +03:00
|
|
|
include::_support/common.inc[]
|
2019-11-12 00:46:05 +03:00
|
|
|
:relative_file_path: README.adoc
|
2019-11-06 23:15:43 +03:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2019-11-12 00:46:05 +03:00
|
|
|
tail -n +3 ${../README.adoc} >> README.adoc
|
2019-11-06 23:15:43 +03:00
|
|
|
|
|
|
|
# Copies the generated asciidoc source for the devices.
|
|
|
|
cp -prf ${devices}/devices devices
|
|
|
|
|
|
|
|
# Use our pipeline to process the docs.
|
|
|
|
process-doc "**/*.adoc" "**/*.md" \
|
|
|
|
--styles-dir="${styles}" \
|
|
|
|
--output-dir="$out"
|
2019-11-09 03:36:05 +03:00
|
|
|
|
|
|
|
rsync --prune-empty-dirs --verbose --archive --include="*.jpeg" --include="*/" --exclude="*" . $out/
|
2019-11-06 23:15:43 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontInstall = true;
|
|
|
|
}
|