From 14269b06a06601aecfd10c33f3f2a45b304b23d5 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 7 Apr 2025 09:14:36 -0500 Subject: [PATCH] docs/flake.nix: add flake outputs for docs We have stuff that's referenced in CI but not available as flake outputs to build. Adding default.nix outputs to flake.nix so flake users can reference them easier. --- docs/flake.lock | 6 +++--- docs/flake.nix | 20 +++++++++++++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/flake.lock b/docs/flake.lock index 4b53be81..837f5d7a 100644 --- a/docs/flake.lock +++ b/docs/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1706683685, - "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", + "lastModified": 1743938762, + "narHash": "sha256-UgFYn8sGv9B8PoFpUfCa43CjMZBl1x/ShQhRDHBFQdI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", + "rev": "74a40410369a1c35ee09b8a1abee6f4acbedc059", "type": "github" }, "original": { diff --git a/docs/flake.nix b/docs/flake.nix index f4aa9567..0abb6815 100644 --- a/docs/flake.nix +++ b/docs/flake.nix @@ -19,7 +19,8 @@ "x86_64-linux" ]; - lib = nixpkgs.lib; + # Note, this should be "the standard library" + HM extensions. + lib = import ../modules/lib/stdlib-extended.nix nixpkgs.lib; forAllSystems = lib.genAttrs supportedSystems; @@ -39,6 +40,8 @@ echo "Generated ./static/style.css" ''; }; + + releaseInfo = lib.importJSON ../release.json; in { devShells = forAllSystems (system: let @@ -50,5 +53,20 @@ packages = [ fpkgs.p-build ]; }; }); + + # Expose the docs outputs + packages = forAllSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + docs = import ./default.nix { + inherit pkgs lib; + release = releaseInfo.release; + isReleaseBranch = releaseInfo.isReleaseBranch; + }; + in { + inherit (docs) manPages jsonModuleMaintainers; + inherit (docs.manual) html htmlOpenTool; + inherit (docs.options) json; + }); }; }