Skip to content

Commit

Permalink
docs: build beta-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Jan 30, 2025
1 parent 6fdfa80 commit fc972cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ lib.fix (
# > sandbox-exec: pattern serialization length 69298 exceeds maximum (65535)
docs = pkgs.callPackage ./mdbook {
inherit evaledModules transformOptions;
inherit (self) search;
inherit (self) search beta-docs;
};

# Beta docs
beta-docs = evaledModules.config.docs.html.site;
}
)
12 changes: 12 additions & 0 deletions docs/mdbook/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
nixosOptionsDoc,
transformOptions,
search,
beta-docs,
# The root directory of the site
baseHref ? "/",
# A list of all available docs that should be linked to
Expand Down Expand Up @@ -371,6 +372,10 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
cp -r ./book/* $dest
mkdir -p $dest/search
cp -r ${finalAttrs.passthru.search}/* $dest/search
# Also build the beta docs
mkdir -p $dest/beta
cp -r ${finalAttrs.passthru.beta-docs}/* $dest/beta
'';

inherit baseHref;
Expand Down Expand Up @@ -401,6 +406,11 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
search = search.override {
baseHref = finalAttrs.baseHref + "search/";
};
beta-docs = beta-docs.override (old: {
settings = lib.recursiveUpdate old.settings {
output.html.site-url = "${baseHref}/beta";
};
});
docs-versions =
runCommand "docs-versions"
{
Expand Down Expand Up @@ -430,6 +440,8 @@ pkgs.stdenv.mkDerivation (finalAttrs: {
echo "- The $link, for use with nixpkgs \`$nixpkgs\`$suffix" >> "$out"
done
# link to beta-docs
echo "- The [beta-docs](./beta), for use with "
'';
user-configs = callPackage ../user-configs { };
};
Expand Down

0 comments on commit fc972cb

Please sign in to comment.