feat: add support for importing nixlets into each other

This commit is contained in:
technofab 2026-02-09 17:37:02 +01:00
parent c44a5fc995
commit 2c21317f45
Signed by: technofab
SSH key fingerprint: SHA256:bV4h88OqS/AxjbPn66uUdvK9JsgIW4tv3vwJQ8tpMqQ
6 changed files with 345 additions and 151 deletions

View file

@ -3,8 +3,22 @@
cell,
...
}: let
inherit (inputs) doclib;
inherit (inputs) pkgs doclib nixlet-lib;
inherit (cell) nixlets;
optionsDoc = doclib.mkOptionDocs {
module = nixlet-lib.nixletModule;
roots = [
{
url = "https://gitlab.com/TECHNOFAB/nixlets/-/blob/main/lib";
path = "${inputs.self}/lib";
}
];
};
optionsDocs = pkgs.runCommand "options-docs" {} ''
mkdir -p $out
ln -s ${optionsDoc} $out/options.md
'';
in
(doclib.mkDocs {
docs."default" = {
@ -23,9 +37,13 @@ in
domains = ["nixlets.projects.tf"];
};
};
macros = {
enable = true;
includeDir = toString optionsDocs;
};
dynamic-nav = {
enable = true;
files."Nixlets Values" = builtins.map (val: {${val.name} = val.mkDocs {};}) (builtins.attrValues nixlets);
files."Nixlets Values" = builtins.map (val: {${val.name} = val.mkDocs {fullValues = true;};}) (builtins.attrValues nixlets);
};
config = {
site_name = "Nixlets";
@ -45,6 +63,7 @@ in
{"Usage" = "usage.md";}
{"Generating Docs" = "generating_docs.md";}
{"Secrets" = "secrets.md";}
{"Options" = "options.md";}
];
markdown_extensions = [
{