From d3ba58e0bdd5a4f579047b6cf72ab056b0041269 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Wed, 24 Jun 2026 03:03:19 +0100 Subject: [PATCH] docs/modules: move rendering logic --- docs/default.nix | 7 ++++--- docs/{lib => modules}/function-locations.nix | 0 docs/{lib/default.nix => modules/render.nix} | 9 +++------ 3 files changed, 7 insertions(+), 9 deletions(-) rename docs/{lib => modules}/function-locations.nix (100%) rename docs/{lib/default.nix => modules/render.nix} (95%) diff --git a/docs/default.nix b/docs/default.nix index 5070b4b1..73d3f70d 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -98,6 +98,9 @@ let inherit transformOptions; }).optionsJSON; + renderDocs = pkgs.callPackage ./modules/render.nix { + inherit nixvim lib; + }; in lib.fix (self: { inherit options-json; @@ -110,9 +113,7 @@ lib.fix (self: { inherit (self) lib-docs; }; - lib-docs = pkgs.callPackage ./lib { - inherit nixvim lib; - }; + lib-docs = renderDocs "nixvim-lib-docs" ./lib/pages.nix; search = mkNuschtosSearch { optionsJSON = options-json + "/share/doc/nixos/options.json"; diff --git a/docs/lib/function-locations.nix b/docs/modules/function-locations.nix similarity index 100% rename from docs/lib/function-locations.nix rename to docs/modules/function-locations.nix diff --git a/docs/lib/default.nix b/docs/modules/render.nix similarity index 95% rename from docs/lib/default.nix rename to docs/modules/render.nix index dc4043ea..b22241ba 100644 --- a/docs/lib/default.nix +++ b/docs/modules/render.nix @@ -4,15 +4,12 @@ runCommand, nixdoc, nixvim, - pageSpecs ? ./pages.nix, }: +name: modules: let menuConfiguration = lib.evalModules { - modules = [ - pageSpecs - ../modules - ]; + modules = [ ../modules ] ++ lib.toList modules; }; cfg = menuConfiguration.config; @@ -53,7 +50,7 @@ let }; result = - runCommand "nixvim-lib-docs" + runCommand name { __structuredAttrs = true; strictDeps = true;