docs: add script to generate some docs from nix attrs

This commit is contained in:
matt1432 2025-01-20 11:06:01 -05:00
parent 5621df5749
commit a4c953df3b
7 changed files with 45 additions and 5 deletions
apps/gen-docs

12
apps/gen-docs/script.sh Executable file
View file

@ -0,0 +1,12 @@
substitute() {
echo '' | pandoc --metadata-file <(
nix eval \
--impure \
--json \
.#"$1" \
--apply "(x: {attrs = builtins.mapAttrs (_: v: v.meta.description or \"\") x.\${builtins.currentSystem};})" |
jq -r
) -t markdown --template "$2" -o "$3"
}
substitute "devShells" "./templates/devShells.md" "$FLAKE/devShells/README.md"