2023-02-20 11:42:13 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
modules,
|
|
|
|
...
|
|
|
|
}: let
|
2022-12-29 17:34:47 +00:00
|
|
|
options = lib.evalModules {
|
2023-05-22 15:45:47 +05:30
|
|
|
inherit modules;
|
2023-02-20 11:42:13 +01:00
|
|
|
specialArgs = {inherit pkgs lib;};
|
2022-12-29 17:34:47 +00:00
|
|
|
};
|
|
|
|
docs = pkgs.nixosOptionsDoc {
|
|
|
|
# If we don't do this, we end up with _module.args on the generated options, which we do not want
|
|
|
|
options = lib.filterAttrs (k: _: k != "_module") options.options;
|
|
|
|
warningsAreErrors = false;
|
|
|
|
};
|
|
|
|
asciidoc = docs.optionsAsciiDoc;
|
|
|
|
in
|
2023-02-20 11:42:13 +01:00
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "nixvim-docs";
|
2022-12-29 17:34:47 +00:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
src = asciidoc;
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.asciidoctor
|
|
|
|
];
|
2022-12-29 17:34:47 +00:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
phases = ["buildPhase"];
|
2022-12-29 17:34:47 +00:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p $out/share/doc
|
|
|
|
cat <<EOF > header.adoc
|
|
|
|
= NixVim options
|
|
|
|
This lists all the options available for NixVim.
|
|
|
|
:toc:
|
2022-12-29 17:34:47 +00:00
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
EOF
|
|
|
|
cat header.adoc $src > tmp.adoc
|
|
|
|
asciidoctor tmp.adoc -o $out/share/doc/index.html
|
|
|
|
'';
|
|
|
|
}
|