2024-02-01 00:41:56 +01:00
|
|
|
{ stdenv, lib, documentation-highlighter, revision, home-manager-options
|
2023-12-09 09:05:16 +01:00
|
|
|
, nixos-render-docs }:
|
2023-11-23 15:18:27 +01:00
|
|
|
let outputPath = "share/doc/home-manager";
|
2023-11-19 08:20:58 +01:00
|
|
|
in stdenv.mkDerivation {
|
2023-11-30 15:13:42 +01:00
|
|
|
name = "home-manager-manual";
|
2023-11-19 08:20:58 +01:00
|
|
|
|
2023-11-25 15:29:26 +01:00
|
|
|
nativeBuildInputs = [ nixos-render-docs ];
|
2023-11-19 08:20:58 +01:00
|
|
|
|
|
|
|
src = ./manual;
|
|
|
|
|
|
|
|
buildPhase = ''
|
2024-02-01 00:41:56 +01:00
|
|
|
mkdir -p out/{highlightjs,media}
|
2023-11-19 08:20:58 +01: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-02-01 00:41:56 +01:00
|
|
|
--subst-var-by \
|
|
|
|
OPTIONS_JSON \
|
2023-11-19 08:20:58 +01:00
|
|
|
${home-manager-options.home-manager}/share/doc/nixos/options.json
|
|
|
|
|
|
|
|
substituteInPlace ./nixos-options.md \
|
2024-02-01 00:41:56 +01:00
|
|
|
--subst-var-by \
|
|
|
|
OPTIONS_JSON \
|
2023-11-19 08:20:58 +01:00
|
|
|
${home-manager-options.nixos}/share/doc/nixos/options.json
|
|
|
|
|
|
|
|
substituteInPlace ./nix-darwin-options.md \
|
2024-02-01 00:41:56 +01:00
|
|
|
--subst-var-by \
|
|
|
|
OPTIONS_JSON \
|
2023-11-19 08:20:58 +01:00
|
|
|
${home-manager-options.nix-darwin}/share/doc/nixos/options.json
|
2023-12-09 13:20:54 +01:00
|
|
|
|
2024-02-01 00:41:56 +01:00
|
|
|
cp ${./static/style.css} out/style.css
|
2023-11-19 08:20:58 +01:00
|
|
|
|
2023-12-16 06:49:25 +01:00
|
|
|
cp -r ${./release-notes} release-notes
|
|
|
|
|
2023-11-25 15:29:26 +01:00
|
|
|
nixos-render-docs manual html \
|
2023-11-19 08:20:58 +01:00
|
|
|
--manpage-urls ./manpage-urls.json \
|
|
|
|
--revision ${lib.trivial.revisionWithDefault revision} \
|
2023-12-09 13:20:54 +01:00
|
|
|
--stylesheet style.css \
|
|
|
|
--script highlightjs/highlight.pack.js \
|
|
|
|
--script highlightjs/loader.js \
|
2023-11-19 08:20:58 +01:00
|
|
|
--toc-depth 1 \
|
|
|
|
--section-toc-depth 1 \
|
|
|
|
manual.md \
|
2023-12-07 13:36:39 +01:00
|
|
|
out/index.xhtml
|
2023-11-19 08:20:58 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
2023-12-16 07:49:45 +01:00
|
|
|
|
|
|
|
meta = { maintainers = [ lib.maintainers.considerate ]; };
|
2023-11-19 08:20:58 +01:00
|
|
|
}
|