2025-01-20 11:06:01 -05:00
|
|
|
substitute() {
|
|
|
|
echo '' | pandoc --metadata-file <(
|
|
|
|
nix eval \
|
|
|
|
--impure \
|
|
|
|
--json \
|
2025-01-20 12:34:07 -05:00
|
|
|
"$FLAKE"#"$1" \
|
2025-01-20 20:37:52 -05:00
|
|
|
--apply "import \"$FLAKE/apps/gen-docs/$3.nix\"" |
|
2025-01-20 11:06:01 -05:00
|
|
|
jq -r
|
2025-01-20 19:04:05 -05:00
|
|
|
) -t markdown --template "$FLAKE/apps/gen-docs/templates/$2.md" -o "$FLAKE/$2/README.md"
|
2025-01-20 11:06:01 -05:00
|
|
|
}
|
|
|
|
|
2025-01-21 13:49:09 -05:00
|
|
|
substituteModule() {
|
|
|
|
echo '' | pandoc --metadata-file <(
|
|
|
|
nix eval \
|
|
|
|
--impure \
|
|
|
|
--json \
|
|
|
|
--expr "\"$FLAKE\"" \
|
|
|
|
--apply "(import \"$FLAKE/apps/gen-docs/getModuleMeta.nix\") \"$1\"" |
|
|
|
|
jq -r
|
|
|
|
) -t markdown --template "$FLAKE/apps/gen-docs/templates/$1.md" -o "$FLAKE/$1/README.md"
|
|
|
|
}
|
|
|
|
|
2025-01-21 14:42:56 -05:00
|
|
|
# TODO: add lib, nixFastChecks, overlays, scopedPackages
|
2025-01-20 20:37:52 -05:00
|
|
|
substitute "appsPackages" "apps" "getPackageMeta"
|
|
|
|
substitute "nixosConfigurations" "configurations" "getConfigMeta"
|
|
|
|
substitute "devShells" "devShells" "getPackageMeta"
|
|
|
|
substitute "packages" "packages" "getPackageMeta"
|
2025-01-21 13:49:09 -05:00
|
|
|
substituteModule "modules"
|
2025-01-21 14:42:56 -05:00
|
|
|
substituteModule "homeManagerModules"
|