nixos-configs/apps/gen-docs/script.sh
matt1432 a4c953df3b
All checks were successful
Discord / discord commits (push) Has been skipped
docs: add script to generate some docs from nix attrs
2025-01-20 11:06:01 -05:00

12 lines
403 B
Bash
Executable file

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"