24 lines
718 B
Bash
Executable file
24 lines
718 B
Bash
Executable file
packageMetaFunc=$(cat << EOF
|
|
(x: {
|
|
attrs = builtins.mapAttrs (_: v: {
|
|
desc = builtins.replaceStrings ["\n"] [" "] (v.meta.description or "");
|
|
homepage = v.meta.homepage or "";
|
|
}) (builtins.removeAttrs x.\${builtins.currentSystem} ["default"]);
|
|
})
|
|
EOF
|
|
)
|
|
|
|
|
|
substitute() {
|
|
echo '' | pandoc --metadata-file <(
|
|
nix eval \
|
|
--impure \
|
|
--json \
|
|
"$FLAKE"#"$1" \
|
|
--apply "$packageMetaFunc" |
|
|
jq -r
|
|
) -t markdown --template "$2" -o "$3"
|
|
}
|
|
|
|
substitute "devShells" "$FLAKE/apps/gen-docs/templates/devShells.md" "$FLAKE/devShells/README.md"
|
|
substitute "appsPackages" "$FLAKE/apps/gen-docs/templates/apps.md" "$FLAKE/apps/README.md"
|