Skip to content
24 changes: 24 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,29 @@
);
};

htmlDocsSchema = {
version = 1;
doc = ''
The `htmlDocs` flake output defines packages providing static HTML output.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we had a convention/requirement about what the entry point to the docs should be (e.g. there should be an $out/index.html) that we could document here (and maybe even enforce in the schema, though I don't think the meta-schema currently supports that). That way, tools like FlakeHub could provide a link to the docs automatically.

Currently this doesn't seem to be the case for Nixpkgs (it has entry points like $out/share/doc/nixpkgs/index.html).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would indeed be a nice convention. If you think the Nixpkgs folks would be amenable I could propose that upstream, but I suspect that a lot of things probably depend on that directory structure at this point.

'';
inventory =
output:
self.lib.mkChildren (
# This requires a special function because this output is structured
# htmlDocs.${package}.${system} rather than the usual ${output}.${system}.${package}
builtins.mapAttrs (packageName: systemsForPackage: {
forSystems = builtins.attrNames systemsForPackage;

children = builtins.mapAttrs (systemType: drv: {
forSystems = [ systemType ];
derivation = drv;
isFlakeCheck = false;
what = "HTML documentation";
}) systemsForPackage;
}) output
);
};

bundlersSchema = {
version = 1;
doc = ''
Expand Down Expand Up @@ -436,6 +459,7 @@
schemas.nixosModules = nixosModulesSchema;
schemas.homeConfigurations = homeConfigurationsSchema;
schemas.homeModules = homeModulesSchema;
schemas.htmlDocs = htmlDocsSchema;
schemas.darwinConfigurations = darwinConfigurationsSchema;
schemas.darwinModules = darwinModulesSchema;
schemas.ociImages = ociImagesSchema;
Expand Down
Loading