diff --git a/docs/man/default.nix b/docs/man/default.nix new file mode 100644 index 000000000..60b5ead74 --- /dev/null +++ b/docs/man/default.nix @@ -0,0 +1,73 @@ +{ pkgs ? import {} }: + +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 = '' + + + + + + ''; + }; + +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; }; +} diff --git a/docs/man/man-nb-options.xml b/docs/man/man-nb-options.xml new file mode 100644 index 000000000..c0e2f5438 --- /dev/null +++ b/docs/man/man-nb-options.xml @@ -0,0 +1,27 @@ + + + nb-options + 5 + nix-bitcoin + + + nb-options + nix-bitcoin configuration specification + + + Description + + This contains the nix-bitcoin module options. + + + + Options + + You can use the following options in configuration.nix: + + + + + diff --git a/docs/man/man-pages.xml b/docs/man/man-pages.xml new file mode 100644 index 000000000..50a0404dc --- /dev/null +++ b/docs/man/man-pages.xml @@ -0,0 +1,13 @@ + + nix-bitcoin Reference Pages + + nix-bitcoin developers + + 2021nix-bitcoin developers + + + + + diff --git a/docs/man/manual.xml b/docs/man/manual.xml new file mode 100644 index 000000000..71cd08a5b --- /dev/null +++ b/docs/man/manual.xml @@ -0,0 +1,32 @@ + + + nix-bitcoin + + + Preface + + Documentation of nix-bitcoin options. + + + If you encounter problems or bugs then please report them on the issue tracker. + + + + nix-bitcoin configuration options +
+ Usage + + To use these options modify your configuration.nix such that it has the format + +
+
+ Options + + +
+
+