2020-10-12 00:22:58 +00:00
|
|
|
{ pkgs
|
|
|
|
|
|
|
|
# Note, this should be "the standard library" + HM extensions.
|
|
|
|
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2023-01-10 09:35:00 +00:00
|
|
|
nmdSrc = fetchTarball {
|
|
|
|
url =
|
|
|
|
"https://gitlab.com/api/v4/projects/rycee%2Fnmd/repository/archive.tar.gz?sha=06c80103396a1a950586c23da1882c977b24bbda";
|
|
|
|
sha256 = "15axmplkl7m7fs4c8m53dawhgwkb64hm2v67m59xdknbjjgfrpqb";
|
2020-10-12 00:22:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 { };
|
|
|
|
};
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
|
2023-01-10 09:35:00 +00:00
|
|
|
dontCheckDefinitions = { _module.check = false; };
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
buildModulesDocs = args:
|
|
|
|
nmd.buildModulesDocs ({
|
|
|
|
moduleRootPaths = [ ./.. ];
|
|
|
|
mkModuleUrl = path:
|
|
|
|
"https://github.com/nix-community/home-manager/blob/master/${path}#blob-path";
|
|
|
|
channelName = "home-manager";
|
|
|
|
} // args);
|
|
|
|
|
|
|
|
hmModulesDocs = buildModulesDocs {
|
2020-10-12 00:22:58 +00:00
|
|
|
modules = import ../modules/modules.nix {
|
|
|
|
inherit lib pkgs;
|
|
|
|
check = false;
|
|
|
|
} ++ [ scrubbedPkgsModule ];
|
|
|
|
docBook.id = "home-manager-options";
|
|
|
|
};
|
|
|
|
|
2021-07-02 22:36:30 +00:00
|
|
|
nixosModuleDocs = buildModulesDocs {
|
2023-01-10 09:35:00 +00:00
|
|
|
modules = [ ../nixos scrubbedPkgsModule dontCheckDefinitions ];
|
2021-07-02 22:36:30 +00:00
|
|
|
docBook = {
|
|
|
|
id = "nixos-options";
|
|
|
|
optionIdPrefix = "nixos-opt";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixDarwinModuleDocs = buildModulesDocs {
|
2023-01-10 09:35:00 +00:00
|
|
|
modules = [ ../nix-darwin scrubbedPkgsModule dontCheckDefinitions ];
|
2021-07-02 22:36:30 +00:00
|
|
|
docBook = {
|
|
|
|
id = "nix-darwin-options";
|
|
|
|
optionIdPrefix = "nix-darwin-opt";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
docs = nmd.buildDocBookDocs {
|
|
|
|
pathName = "home-manager";
|
2023-01-10 09:35:00 +00:00
|
|
|
projectName = "Home Manager";
|
2021-07-02 22:36:30 +00:00
|
|
|
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
|
2020-10-12 00:22:58 +00:00
|
|
|
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>
|
2021-07-02 22:36:30 +00:00
|
|
|
<d:tocentry linkend="ch-nixos-options"><?dbhtml filename="nixos-options.html"?></d:tocentry>
|
|
|
|
<d:tocentry linkend="ch-nix-darwin-options"><?dbhtml filename="nix-darwin-options.html"?></d:tocentry>
|
2020-10-12 00:22:58 +00:00
|
|
|
<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; };
|
2023-01-10 09:35:00 +00:00
|
|
|
|
|
|
|
# Unstable, mainly for CI.
|
|
|
|
jsonModuleMaintainers = pkgs.writeText "hm-module-maintainers.json" (let
|
|
|
|
result = lib.evalModules {
|
|
|
|
modules = import ../modules/modules.nix {
|
|
|
|
inherit lib pkgs;
|
|
|
|
check = false;
|
|
|
|
} ++ [ scrubbedPkgsModule ];
|
|
|
|
};
|
|
|
|
in builtins.toJSON result.config.meta.maintainers);
|
2020-10-12 00:22:58 +00:00
|
|
|
}
|