parent
6aca512b8a
commit
5194199d25
14 changed files with 105 additions and 21 deletions
apps/gen-docs
|
@ -1,9 +1,11 @@
|
|||
packageMetaFunc=$(cat << EOF
|
||||
getMetaFunc=$(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"]);
|
||||
roleDesc = builtins.replaceStrings ["\n"] [" "] (v.config.meta.roleDescription or "");
|
||||
hwDesc = builtins.replaceStrings ["\n"] [" "] (v.config.meta.hardwareDescription or "");
|
||||
}) (builtins.removeAttrs (x.\${builtins.currentSystem} or x) ["default"]);
|
||||
})
|
||||
EOF
|
||||
)
|
||||
|
@ -15,12 +17,13 @@ substitute() {
|
|||
--impure \
|
||||
--json \
|
||||
"$FLAKE"#"$1" \
|
||||
--apply "$packageMetaFunc" |
|
||||
--apply "$getMetaFunc" |
|
||||
jq -r
|
||||
) -t markdown --template "$2" -o "$3"
|
||||
) -t markdown --template "$FLAKE/apps/gen-docs/templates/$2.md" -o "$FLAKE/$2/README.md"
|
||||
}
|
||||
|
||||
# TODO: add configurations, homeManagerModules, lib, modules, nixFastChecks, overlays, scopedPackages
|
||||
substitute "appsPackages" "$FLAKE/apps/gen-docs/templates/apps.md" "$FLAKE/apps/README.md"
|
||||
substitute "devShells" "$FLAKE/apps/gen-docs/templates/devShells.md" "$FLAKE/devShells/README.md"
|
||||
substitute "packages" "$FLAKE/apps/gen-docs/templates/packages.md" "$FLAKE/packages/README.md"
|
||||
# TODO: add homeManagerModules, lib, modules, nixFastChecks, overlays, scopedPackages
|
||||
substitute "appsPackages" "apps"
|
||||
substitute "nixosConfigurations" "configurations"
|
||||
substitute "devShells" "devShells"
|
||||
substitute "packages" "packages"
|
||||
|
|
13
apps/gen-docs/templates/configurations.md
Normal file
13
apps/gen-docs/templates/configurations.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# nixosConfigurations
|
||||
|
||||
This directory contains every device's main configuration file, their `hardware-configuration.nix` and some custom modules
|
||||
unique to them.
|
||||
|
||||
## List of my Devices
|
||||
|
||||
| Name | Model / Specs | Description |
|
||||
| --------- | ------------- | ------------------------------------------------------------------------------------------------ |
|
||||
| `android` | OnePlus 9 Pro | [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro |
|
||||
$for(attrs/pairs)$
|
||||
| `$it.key$` | $it.value.hwDesc/nowrap$ | $it.value.roleDesc/nowrap$ |
|
||||
$endfor$
|
|
@ -4,8 +4,8 @@ This directory contains every derivations for packages exposed by this flake.
|
|||
|
||||
## List of my packages found in `self.packages`
|
||||
|
||||
| Name | Description |
|
||||
| ---- | ----------- |
|
||||
| Name | Description | Homepage |
|
||||
| ---- | ----------- | -------- |
|
||||
$for(attrs/pairs)$
|
||||
| `$it.key$` | $it.value.desc/nowrap$ | $it.value.homepage/nowrap$ |
|
||||
$endfor$
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue