devshell/nix/repo/docs.nix
2025-09-15 16:02:36 +02:00

70 lines
1.8 KiB
Nix

{inputs, ...}: let
inherit (inputs) pkgs devshell doclib;
optionsDoc = doclib.mkOptionDocs {
module = devshell.modules;
roots = [
{
url = "https://gitlab.com/rensa-nix/devshell/-/blob/main/lib";
path = "${inputs.self}/lib";
}
];
};
optionsDocs = pkgs.runCommand "options-docs" {} ''
mkdir -p $out
ln -s ${optionsDoc} $out/options.md
'';
in
(doclib.mkDocs {
docs."default" = {
base = "${inputs.self}";
path = "${inputs.self}/docs";
material = {
enable = true;
colors = {
primary = "aqua";
accent = "blue";
};
umami = {
enable = true;
src = "https://analytics.tf/umami";
siteId = "8f6d1692-a0e9-4a99-85cc-22fb38e1c82b";
domains = ["devshell.rensa.projects.tf"];
};
};
macros = {
enable = true;
includeDir = toString optionsDocs;
};
config = {
site_name = "Devshell";
repo_name = "rensa-nix/devshell";
repo_url = "https://gitlab.com/rensa-nix/devshell";
theme = {
logo = "images/logo.svg";
icon.repo = "simple/gitlab";
favicon = "images/logo.svg";
};
nav = [
{"Introduction" = "index.md";}
{"Usage" = "usage.md";}
{"Integrations" = "integrations.md";}
{"Examples" = "examples.md";}
{"Options" = "options.md";}
];
markdown_extensions = [
{
"pymdownx.highlight".pygments_lang_class = true;
}
"pymdownx.inlinehilite"
"pymdownx.snippets"
"pymdownx.superfences"
"pymdownx.escapeall"
"fenced_code"
];
};
};
}).packages
// {
inherit optionsDocs;
}