1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 19:49:45 +01:00
home-manager/doc/default.nix
Robert Helgesson f735fac91b
doc: bump nmd revision
Also convert `release-notes.xml` to AsciiDoc.
2020-04-22 23:59:09 +02:00

68 lines
1.8 KiB
Nix

{
# Note, this should be "the standard library" + HM extensions.
lib, pkgs }:
let
nmdSrc = pkgs.fetchFromGitLab {
name = "nmd";
owner = "rycee";
repo = "nmd";
rev = "49567e3ff2824ac8ba457f439f384eafc1eb4547";
sha256 = "0x2lwcryvmnr128r497bzrawi4x1yyxb4riicppdaib95iwn8jck";
};
nmd = import nmdSrc { inherit lib pkgs; };
# Make sure the used package is scrubbed to avoid actually
# instantiating derivations.
scrubbedPkgsModule = {
imports = [{
_module.args = {
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
pkgs_i686 = lib.mkForce { };
};
}];
};
hmModulesDocs = nmd.buildModulesDocs {
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [ scrubbedPkgsModule ];
moduleRootPaths = [ ./.. ];
mkModuleUrl = path:
"https://github.com/rycee/home-manager/blob/master/${path}#blob-path";
channelName = "home-manager";
docBook.id = "home-manager-options";
};
docs = nmd.buildDocBookDocs {
pathName = "home-manager";
modulesDocs = [ hmModulesDocs ];
documentsDirectory = ./.;
documentType = "book";
chunkToc = ''
<toc>
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-home-manager-manual"><?dbhtml filename="index.html"?>
<d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
</d:tocentry>
</toc>
'';
};
in {
inherit nmdSrc;
options = {
json = hmModulesDocs.json.override {
path = "share/doc/home-manager/options.json";
};
};
manPages = docs.manPages;
manual = { inherit (docs) html htmlOpenTool; };
}