Skip to content

docs: add module-docs auto-generator for NixOS and flake module options#80

Open
manveru wants to merge 1 commit intomainfrom
module-docs
Open

docs: add module-docs auto-generator for NixOS and flake module options#80
manveru wants to merge 1 commit intomainfrom
module-docs

Conversation

@manveru
Copy link
Contributor

@manveru manveru commented Feb 19, 2026

Adds perSystem/packages/module-docs.nix which builds nixosOptionsDoc-based Markdown for all cardano-parts options:

nix build .#module-docs-nixos # NixOS module options
nix build .#module-docs-flake # flake module options
nix build .#module-docs # both combined

NixOS modules (Tier 1-3 fully documented):

  • profile-cardano-node-topology, module-nginx-vhost-exporter, profile-aws-ec2-ephemeral, profile-cardano-postgres, profile-mithril-relay, profile-cardano-custom-metrics, profile-tcpdump, profile-blockperf, profile-grafana-alloy, profile-cardano-node-group, role-block-producer, profile-cardano-db-sync, profile-cardano-db-sync-snapshots, profile-cardano-webserver, profile-cardano-faucet, profile-cardano-metadata, profile-cardano-smash, service-cardano-faucet

Flake modules (all four namespaces documented):

  • flake.cardano-parts.cluster, flake.cardano-parts.pkgs, flake.cardano-parts.lib, flake.cardano-parts.aws

Flake docs use a standalone lib.evalModules with only the four cardano-parts flake modules rather than the full flake-parts eval (which would trigger perSystem package evaluation without a system context, causing a "process-compose option has no value" error). All complex defaults in flakeModules get defaultText to prevent stack overflow in generators.toPretty (the self-referential groupFlake = flake default was the original trigger).

Supporting changes:

  • flakeModules/cluster.nix: add defaultText to all complex defaults; allow null in optionCheck; fix conditional kms/bucketName defaults; fix groupMeta.domain type to nullOr str
  • flakeModules/pkgs.nix: add defaultText to mkPkg helper and all special function options
  • flakeModules/shell.nix: add defaultText to complex shell defaults
  • flakeModules/aws.nix: add defaultText with literalExpression to rawSpec and spec options
  • flake/nixosModules/profile-cardano-parts.nix: drop deprecated lib.mdDoc wrappers (plain strings are now implicit Markdown)

Adds `perSystem/packages/module-docs.nix` which builds
`nixosOptionsDoc`-based Markdown for all cardano-parts options:

  nix build .#module-docs-nixos   # NixOS module options
  nix build .#module-docs-flake   # flake module options
  nix build .#module-docs         # both combined

NixOS modules (Tier 1-3 fully documented):
- profile-cardano-node-topology, module-nginx-vhost-exporter,
  profile-aws-ec2-ephemeral, profile-cardano-postgres,
  profile-mithril-relay, profile-cardano-custom-metrics,
  profile-tcpdump, profile-blockperf, profile-grafana-alloy,
  profile-cardano-node-group, role-block-producer,
  profile-cardano-db-sync, profile-cardano-db-sync-snapshots,
  profile-cardano-webserver, profile-cardano-faucet,
  profile-cardano-metadata, profile-cardano-smash,
  service-cardano-faucet

Flake modules (all four namespaces documented):
- flake.cardano-parts.cluster, flake.cardano-parts.pkgs,
  flake.cardano-parts.lib, flake.cardano-parts.aws

Flake docs use a standalone lib.evalModules with only the four
cardano-parts flake modules rather than the full flake-parts
eval (which would trigger perSystem package evaluation without a
system context, causing a "process-compose option has no value"
error). All complex defaults in flakeModules get defaultText to
prevent stack overflow in generators.toPretty (the self-referential
groupFlake = flake default was the original trigger).

Supporting changes:
- flakeModules/cluster.nix: add defaultText to all complex defaults;
  allow null in optionCheck; fix conditional kms/bucketName defaults;
  fix groupMeta.domain type to nullOr str
- flakeModules/pkgs.nix: add defaultText to mkPkg helper and all
  special function options
- flakeModules/shell.nix: add defaultText to complex shell defaults
- flakeModules/aws.nix: add defaultText with literalExpression to
  rawSpec and spec options
- flake/nixosModules/profile-cardano-parts.nix: drop deprecated
  lib.mdDoc wrappers (plain strings are now implicit Markdown)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant