docs/config-examples: generate dynamically from a toml list

This should help to maintain uniformity and hopefully make contributions
easier.

Kept regression tests local to the derivation, however these are also
added to the flake checks.
This commit is contained in:
Matt Sturgeon 2024-12-14 18:54:27 +00:00
parent 8eeea073fc
commit a658e81d71
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
6 changed files with 361 additions and 56 deletions

View file

@ -1,5 +1,6 @@
{
pkgs,
callPackage,
runCommand,
lib,
evaledModules,
@ -349,6 +350,10 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
substituteInPlace ./index.md \
--replace-fail "@DOCS_VERSIONS@" "$(cat ${finalAttrs.passthru.docs-versions})"
# Patch user-configs
substituteInPlace ./user-guide/config-examples.md \
--replace-fail "@USER_CONFIGS@" "$(cat ${finalAttrs.passthru.user-configs})"
mdbook build
cp -r ./book/* $dest
mkdir -p $dest/search
@ -398,5 +403,6 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
echo "- The $link, for use with nixpkgs \`$nixpkgs\`$suffix" >> "$out"
done
'';
user-configs = callPackage ../user-configs { };
};
})