mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 15:09:46 +01:00
db86bd6c01
Also perform scrubbing of `pkgs` since nmd no longer does this automatically.
71 lines
1.7 KiB
Nix
71 lines
1.7 KiB
Nix
{ pkgs }:
|
|
|
|
let
|
|
|
|
lib = pkgs.lib;
|
|
|
|
nmdSrc = pkgs.fetchFromGitLab {
|
|
owner = "rycee";
|
|
repo = "nmd";
|
|
rev = "9751ca5ef6eb2ef27470010208d4c0a20e89443d";
|
|
sha256 = "0rbx10n8kk0bvp1nl5c8q79lz1w0p1b8103asbvwps3gmqd070hi";
|
|
};
|
|
|
|
nmd = import nmdSrc { inherit 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; }
|
|
++ [ 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 = ./.;
|
|
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
|
|
|
|
{
|
|
|
|
options = {
|
|
json = hmModulesDocs.json.override {
|
|
path = "share/doc/home-manager/options.json";
|
|
};
|
|
};
|
|
|
|
manPages = docs.manPages;
|
|
|
|
manual = {
|
|
inherit (docs) html htmlOpenTool;
|
|
};
|
|
|
|
}
|