forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs.nix
39 lines (35 loc) · 858 Bytes
/
docs.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
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
'';
}