mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
39 lines
858 B
Nix
39 lines
858 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
modules,
|
|
...
|
|
}: let
|
|
options = lib.evalModules {
|
|
inherit modules;
|
|
specialArgs = {inherit pkgs lib;};
|
|
};
|
|
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
|
|
pkgs.stdenv.mkDerivation {
|
|
name = "nixvim-docs";
|
|
|
|
src = asciidoc;
|
|
buildInputs = [
|
|
pkgs.asciidoctor
|
|
];
|
|
|
|
phases = ["buildPhase"];
|
|
|
|
buildPhase = ''
|
|
mkdir -p $out/share/doc
|
|
cat <<EOF > header.adoc
|
|
= NixVim options
|
|
This lists all the options available for NixVim.
|
|
:toc:
|
|
|
|
EOF
|
|
cat header.adoc $src > tmp.adoc
|
|
asciidoctor tmp.adoc -o $out/share/doc/index.html
|
|
'';
|
|
}
|