Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: manpage #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions docs/man/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{ pkgs ? import <nixpkgs> {} }:

let

lib = pkgs.lib;

nmdSrc = pkgs.fetchFromGitLab {
name = "nmd";
owner = "rycee";
repo = "nmd";
rev = "2398aa79ab12aa7aba14bc3b08a6efd38ebabdc5";
sha256 = "0yxb48afvccn8vvpkykzcr4q1rgv8jsijqncia7a5ffzshcrwrnh";
};

nmd = import nmdSrc { inherit pkgs; };

# Make sure the used package is scrubbed to avoid actually instantiating
# derivations.
#
# Also disable checking since we'll be referring to undefined options.
setupModule = {
imports = [{
_module.args = {
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
};
_module.check = false;
}];
};

nbModulesDocs = nmd.buildModulesDocs {
modules = let
nixosModule = module: pkgs.path + "/nixos/modules" + module;
in [
../../modules/bitcoind.nix
(nixosModule "/misc/assertions.nix")
setupModule
];
moduleRootPaths = [ ../modules ];
mkModuleUrl = path:
"https://github.com/fort-nix/nix-bitcoin/blob/master/${path}#blob-path";
channelName = "nix-bitcoin";
docBook.id = "nb-options";
};

docs = nmd.buildDocBookDocs {
pathName = "nix-bitcoin";
modulesDocs = [ nbModulesDocs ];
documentsDirectory = ./.;
chunkToc = ''
<toc>
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-nix-bitcoin-manual"><?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-nb-options"><?dbhtml filename="nb-options.html"?></d:tocentry>
</d:tocentry>
</toc>
'';
};

in {
options = {
json = pkgs.symlinkJoin {
name = "nix-bitcoin-options-json";
paths = [
(nbModulesDocs.json.override {
path = "share/doc/nix-bitcoin/nb-options.json";
})
];
};
};

manPages = docs.manPages;

manual = { inherit (docs) html htmlOpenTool; };
}
27 changes: 27 additions & 0 deletions docs/man/man-nb-options.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refmeta>
<refentrytitle><filename>nb-options</filename>
</refentrytitle><manvolnum>5</manvolnum>
<refmiscinfo class="source">nix-bitcoin</refmiscinfo>
</refmeta>
<refnamediv>
<refname><filename>nb-options</filename>
</refname><refpurpose>nix-bitcoin configuration specification</refpurpose>
</refnamediv>
<refsection>
<title>Description</title>
<para>
This contains the nix-bitcoin module options.
</para>
</refsection>
<refsection>
<title>Options</title>
<para>
You can use the following options in <filename>configuration.nix</filename>:
</para>
<xi:include href="./nmd-result/nb-options.xml" />
</refsection>
</refentry>

13 changes: 13 additions & 0 deletions docs/man/man-pages.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<reference xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude">
<title>nix-bitcoin Reference Pages</title>
<info>
<author><personname>nix-bitcoin developers</personname>
</author>
<copyright><year>2021</year><holder>nix-bitcoin developers</holder>
</copyright>
</info>
<xi:include href="man-nb-options.xml" />
</reference>

32 changes: 32 additions & 0 deletions docs/man/manual.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="book-nix-bitcoin-manual">
<info>
<title>nix-bitcoin</title>
</info>
<preface>
<title>Preface</title>
<para>
Documentation of nix-bitcoin options.
</para>
<para>
If you encounter problems or bugs then please report them on the <link xlink:href="https://gitlab.com/rycee/nur-expressions/issues">issue tracker</link>.
</para>
</preface>
<appendix xml:id="ch-nb-options">
<title>nix-bitcoin configuration options</title>
<section xml:id="sec-nb-usage">
<title>Usage</title>
<para>
To use these options modify your <filename>configuration.nix</filename> such that it has the format
</para>
</section>
<section xml:id="sec-nb-options">
<title>Options</title>

<xi:include href="./nmd-result/nb-options.xml" />
</section>
</appendix>
</book>