parent
a42f4091d0
commit
fffcce6d29
3 changed files with 59 additions and 10 deletions
apps/gen-docs
|
@ -1,4 +1,4 @@
|
|||
substitute() {
|
||||
substituteDerivs() {
|
||||
echo '' | pandoc --metadata-file <(
|
||||
nix eval \
|
||||
--impure \
|
||||
|
@ -20,13 +20,24 @@ substituteAttrs() {
|
|||
) -t markdown --template "$FLAKE/apps/gen-docs/templates/$1.md" -o "$FLAKE/$1/README.md"
|
||||
}
|
||||
|
||||
substitute "appsPackages" "apps" "getPackageMeta"
|
||||
substitute "nixosConfigurations" "configurations" "getConfigMeta"
|
||||
substitute "devShells" "devShells" "getPackageMeta"
|
||||
substitute "packages" "packages" "getPackageMeta"
|
||||
substituteScopes() {
|
||||
echo '' | pandoc --metadata-file <(
|
||||
nix eval \
|
||||
--impure \
|
||||
--json \
|
||||
--expr "\"$FLAKE\"" \
|
||||
--apply "(import \"$FLAKE/apps/gen-docs/getScopesMeta.nix\") \"$1\"" |
|
||||
jq -r
|
||||
) -t markdown --template "$FLAKE/apps/gen-docs/templates/$1.md" -o "$FLAKE/$1/README.md"
|
||||
}
|
||||
|
||||
substituteDerivs "appsPackages" "apps" "getPackageMeta"
|
||||
substituteDerivs "nixosConfigurations" "configurations" "getConfigMeta"
|
||||
substituteDerivs "devShells" "devShells" "getPackageMeta"
|
||||
substituteDerivs "packages" "packages" "getPackageMeta"
|
||||
|
||||
substituteAttrs "modules"
|
||||
substituteAttrs "homeManagerModules"
|
||||
substituteAttrs "overlays"
|
||||
|
||||
# TODO: add metadata of all packages
|
||||
substituteAttrs "scopedPackages"
|
||||
substituteScopes "scopedPackages"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue