docs: take defaults from environment variables

When building with --impure, accept the following environment variables
for docs inputs:
- NIXVIM_DOCS_BASE_HREF → baseHref
- NIXVIM_DOCS_AVAILABLE_VERSIONS → availableVersions

This allows simplifying the `website` CI workflow.
This commit is contained in:
Matt Sturgeon 2026-06-07 20:30:56 +01:00
parent 98acb923e5
commit 70886b715e

View file

@ -1,3 +1,4 @@
# NOTE: to use defaults from the environment, you must build with --impure
{
pkgs,
callPackage,
@ -9,10 +10,10 @@
search,
lib-docs,
# The root directory of the site
baseHref ? "/",
baseHref ? lib.maybeEnv "NIXVIM_DOCS_BASE_HREF" "/",
# A list of all available docs that should be linked to
# Each element should contain { branch; nixpkgsBranch; baseHref; status; }
availableVersions ? [ ],
availableVersions ? builtins.fromJSON (lib.maybeEnv "NIXVIM_DOCS_AVAILABLE_VERSIONS" "[]"),
}:
let
inherit (configuration.config.meta) nixvimInfo;