feat: refactor to add apps README

This commit is contained in:
matt1432 2025-01-20 12:34:07 -05:00
parent 2cab8107ba
commit 546eda3ee2
12 changed files with 81 additions and 52 deletions
apps/gen-docs

View file

@ -1,7 +1,7 @@
packageMetaFunc=$(cat << EOF
(x: {
attrs = builtins.mapAttrs (_: v: {
desc = builtins.replaceStrings ["\n"] [""] (v.meta.description or "");
desc = builtins.replaceStrings ["\n"] [" "] (v.meta.description or "");
homepage = v.meta.homepage or "";
}) (builtins.removeAttrs x.\${builtins.currentSystem} ["default"]);
})
@ -14,10 +14,11 @@ substitute() {
nix eval \
--impure \
--json \
.#"$1" \
"$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"