From fc1b58b593bf8257a7757e69b9a70c2ca3337e20 Mon Sep 17 00:00:00 2001 From: pennae Date: Fri, 23 Jun 2023 02:02:57 +0200 Subject: doc: inline doc-support to main drv separating function docs out like this makes it less clear how library documentation is generated and integrated into the build. if in the future more parts of nixpkgs use nixdoc it will make sense to have all information about library doc generation in the same place. --- doc/default.nix | 21 ++++++++++++++++++--- doc/doc-support/default.nix | 28 ---------------------------- 2 files changed, 18 insertions(+), 31 deletions(-) delete mode 100644 doc/doc-support/default.nix (limited to 'doc') diff --git a/doc/default.nix b/doc/default.nix index 2133a06e0f467..5954e4495adb9 100644 --- a/doc/default.nix +++ b/doc/default.nix @@ -3,7 +3,23 @@ let inherit (pkgs) lib; inherit (lib) hasPrefix removePrefix; - doc-support = import ./doc-support { inherit pkgs nixpkgs; }; + lib-docs = import ./doc-support/lib-function-docs.nix { + inherit pkgs nixpkgs; + libsets = [ + { name = "asserts"; description = "assertion functions"; } + { name = "attrsets"; description = "attribute set functions"; } + { name = "strings"; description = "string manipulation functions"; } + { name = "versions"; description = "version string functions"; } + { name = "trivial"; description = "miscellaneous functions"; } + { name = "lists"; description = "list manipulation functions"; } + { name = "debug"; description = "debugging functions"; } + { name = "options"; description = "NixOS / nixpkgs option handling"; } + { name = "path"; description = "path functions"; } + { name = "filesystem"; description = "filesystem functions"; } + { name = "sources"; description = "source filtering functions"; } + { name = "cli"; description = "command-line serialization functions"; } + ]; + }; epub = pkgs.runCommand "manual.epub" { nativeBuildInputs = with pkgs; [ libxslt zip ]; @@ -78,14 +94,13 @@ in pkgs.stdenv.mkDerivation { src = ./.; postPatch = '' - ln -s ${doc-support} ./doc-support/result ln -s ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./config-options.json ''; buildPhase = '' cat \ ./functions/library.md.in \ - ./doc-support/result/function-docs/index.md \ + ${lib-docs}/index.md \ > ./functions/library.md substitute ./manual.md.in ./manual.md \ --replace '@MANUAL_VERSION@' '${pkgs.lib.version}' diff --git a/doc/doc-support/default.nix b/doc/doc-support/default.nix deleted file mode 100644 index 082b585fc9371..0000000000000 --- a/doc/doc-support/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ pkgs ? (import ../.. {}), nixpkgs ? { }}: -let - libsets = [ - { name = "asserts"; description = "assertion functions"; } - { name = "attrsets"; description = "attribute set functions"; } - { name = "strings"; description = "string manipulation functions"; } - { name = "versions"; description = "version string functions"; } - { name = "trivial"; description = "miscellaneous functions"; } - { name = "lists"; description = "list manipulation functions"; } - { name = "debug"; description = "debugging functions"; } - { name = "options"; description = "NixOS / nixpkgs option handling"; } - { name = "path"; description = "path functions"; } - { name = "filesystem"; description = "filesystem functions"; } - { name = "sources"; description = "source filtering functions"; } - { name = "cli"; description = "command-line serialization functions"; } - ]; - - functionDocs = import ./lib-function-docs.nix { inherit pkgs nixpkgs libsets; }; - -in pkgs.runCommand "doc-support" {} -'' - mkdir result - ( - cd result - ln -s ${functionDocs} ./function-docs - ) - mv result $out -'' -- cgit 1.4.1