2024-06-04 18:23:39 +00:00
|
|
|
{ stdenv, lib, documentation-highlighter, revision, home-manager-options
|
2024-01-05 11:06:15 +00:00
|
|
|
, nixos-render-docs }:
|
|
|
|
let outputPath = "share/doc/home-manager";
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
name = "home-manager-manual";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ nixos-render-docs ];
|
|
|
|
|
|
|
|
src = ./manual;
|
|
|
|
|
|
|
|
buildPhase = ''
|
2024-06-04 18:23:39 +00:00
|
|
|
mkdir -p out/{highlightjs,media}
|
2024-01-05 11:06:15 +00:00
|
|
|
|
|
|
|
cp -t out/highlightjs \
|
|
|
|
${documentation-highlighter}/highlight.pack.js \
|
|
|
|
${documentation-highlighter}/LICENSE \
|
|
|
|
${documentation-highlighter}/mono-blue.css \
|
|
|
|
${documentation-highlighter}/loader.js
|
|
|
|
|
|
|
|
substituteInPlace ./options.md \
|
2024-06-04 18:23:39 +00:00
|
|
|
--subst-var-by \
|
|
|
|
OPTIONS_JSON \
|
2024-01-05 11:06:15 +00:00
|
|
|
${home-manager-options.home-manager}/share/doc/nixos/options.json
|
|
|
|
|
|
|
|
substituteInPlace ./nixos-options.md \
|
2024-06-04 18:23:39 +00:00
|
|
|
--subst-var-by \
|
|
|
|
OPTIONS_JSON \
|
2024-01-05 11:06:15 +00:00
|
|
|
${home-manager-options.nixos}/share/doc/nixos/options.json
|
|
|
|
|
|
|
|
substituteInPlace ./nix-darwin-options.md \
|
2024-06-04 18:23:39 +00:00
|
|
|
--subst-var-by \
|
|
|
|
OPTIONS_JSON \
|
2024-01-05 11:06:15 +00:00
|
|
|
${home-manager-options.nix-darwin}/share/doc/nixos/options.json
|
|
|
|
|
2024-06-04 18:23:39 +00:00
|
|
|
cp ${./static/style.css} out/style.css
|
2024-01-05 11:06:15 +00:00
|
|
|
|
|
|
|
cp -r ${./release-notes} release-notes
|
|
|
|
|
|
|
|
nixos-render-docs manual html \
|
|
|
|
--manpage-urls ./manpage-urls.json \
|
|
|
|
--revision ${lib.trivial.revisionWithDefault revision} \
|
|
|
|
--stylesheet style.css \
|
|
|
|
--script highlightjs/highlight.pack.js \
|
|
|
|
--script highlightjs/loader.js \
|
|
|
|
--toc-depth 1 \
|
|
|
|
--section-toc-depth 1 \
|
|
|
|
manual.md \
|
|
|
|
out/index.xhtml
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
dest="$out/${outputPath}"
|
|
|
|
mkdir -p "$(dirname "$dest")"
|
|
|
|
mv out "$dest"
|
|
|
|
|
|
|
|
mkdir -p $out/nix-support/
|
|
|
|
echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = { maintainers = [ lib.maintainers.considerate ]; };
|
|
|
|
}
|