2020-06-06 20:08:02 +00:00
|
|
|
{ pkgs
|
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
# Note, this should be "the standard library" + HM extensions.
|
2020-06-06 20:08:02 +00:00
|
|
|
, lib ? import ../modules/lib/stdlib-extended.nix pkgs.lib }:
|
2018-05-06 20:14:50 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2018-12-18 17:09:56 +00:00
|
|
|
nmdSrc = pkgs.fetchFromGitLab {
|
2019-08-28 18:36:11 +00:00
|
|
|
name = "nmd";
|
2018-12-18 17:09:56 +00:00
|
|
|
owner = "rycee";
|
|
|
|
repo = "nmd";
|
2021-10-12 21:42:17 +00:00
|
|
|
rev = "12bc57594e12525d2e4422fa7034b2d54e9ea09a";
|
|
|
|
sha256 = "0fpankfx2c99x4n1mhdy730yxy2b03qcw4zvjxyk4b1v60h8057n";
|
2018-12-18 17:09:56 +00:00
|
|
|
};
|
|
|
|
|
2020-01-16 22:41:14 +00:00
|
|
|
nmd = import nmdSrc { inherit lib pkgs; };
|
2018-12-18 17:09:56 +00:00
|
|
|
|
2019-08-27 21:40:52 +00:00
|
|
|
# Make sure the used package is scrubbed to avoid actually
|
|
|
|
# instantiating derivations.
|
|
|
|
scrubbedPkgsModule = {
|
2020-02-01 23:39:17 +00:00
|
|
|
imports = [{
|
|
|
|
_module.args = {
|
|
|
|
pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs);
|
|
|
|
pkgs_i686 = lib.mkForce { };
|
|
|
|
};
|
|
|
|
}];
|
2019-08-27 21:40:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-18 22:21:32 +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-02-01 23:39:17 +00:00
|
|
|
modules = import ../modules/modules.nix {
|
|
|
|
inherit lib pkgs;
|
|
|
|
check = false;
|
|
|
|
} ++ [ scrubbedPkgsModule ];
|
2018-12-18 17:09:56 +00:00
|
|
|
docBook.id = "home-manager-options";
|
|
|
|
};
|
|
|
|
|
2021-01-18 22:21:32 +00:00
|
|
|
nixosModuleDocs = buildModulesDocs {
|
|
|
|
modules = let
|
|
|
|
nixosModule = module: pkgs.path + "/nixos/modules" + module;
|
|
|
|
mockedNixos = with lib; {
|
|
|
|
options = {
|
|
|
|
environment.pathsToLink = mkSinkUndeclaredOptions { };
|
|
|
|
systemd.services = mkSinkUndeclaredOptions { };
|
|
|
|
users.users = mkSinkUndeclaredOptions { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in [
|
|
|
|
../nixos/default.nix
|
|
|
|
mockedNixos
|
|
|
|
(nixosModule "/misc/assertions.nix")
|
|
|
|
scrubbedPkgsModule
|
|
|
|
];
|
|
|
|
docBook = {
|
|
|
|
id = "nixos-options";
|
|
|
|
optionIdPrefix = "nixos-opt";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nixDarwinModuleDocs = buildModulesDocs {
|
|
|
|
modules = let
|
|
|
|
nixosModule = module: pkgs.path + "/nixos/modules" + module;
|
|
|
|
mockedNixDarwin = with lib; {
|
|
|
|
options = {
|
|
|
|
environment.pathsToLink = mkSinkUndeclaredOptions { };
|
|
|
|
system.activationScripts.postActivation.text =
|
|
|
|
mkSinkUndeclaredOptions { };
|
|
|
|
users.users = mkSinkUndeclaredOptions { };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in [
|
|
|
|
../nix-darwin/default.nix
|
|
|
|
mockedNixDarwin
|
|
|
|
(nixosModule "/misc/assertions.nix")
|
|
|
|
scrubbedPkgsModule
|
|
|
|
];
|
|
|
|
docBook = {
|
|
|
|
id = "nix-darwin-options";
|
|
|
|
optionIdPrefix = "nix-darwin-opt";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-12-18 17:09:56 +00:00
|
|
|
docs = nmd.buildDocBookDocs {
|
|
|
|
pathName = "home-manager";
|
2021-01-18 22:21:32 +00:00
|
|
|
modulesDocs = [ hmModulesDocs nixDarwinModuleDocs nixosModuleDocs ];
|
2018-12-18 17:09:56 +00:00
|
|
|
documentsDirectory = ./.;
|
2020-04-19 09:53:31 +00:00
|
|
|
documentType = "book";
|
2018-12-18 17:09:56 +00:00
|
|
|
chunkToc = ''
|
|
|
|
<toc>
|
2018-05-06 20:14:50 +00:00
|
|
|
<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-01-18 22:21:32 +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>
|
2019-06-08 23:47:43 +00:00
|
|
|
<d:tocentry linkend="ch-tools"><?dbhtml filename="tools.html"?></d:tocentry>
|
2019-01-20 16:38:34 +00:00
|
|
|
<d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
|
2018-05-06 20:14:50 +00:00
|
|
|
</d:tocentry>
|
|
|
|
</toc>
|
|
|
|
'';
|
2018-12-18 17:09:56 +00:00
|
|
|
};
|
2018-05-06 20:14:50 +00:00
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
in {
|
2019-08-28 18:36:11 +00:00
|
|
|
inherit nmdSrc;
|
2018-05-06 20:14:50 +00:00
|
|
|
|
2018-12-18 17:09:56 +00:00
|
|
|
options = {
|
|
|
|
json = hmModulesDocs.json.override {
|
|
|
|
path = "share/doc/home-manager/options.json";
|
|
|
|
};
|
|
|
|
};
|
2018-05-06 20:14:50 +00:00
|
|
|
|
2018-12-18 17:09:56 +00:00
|
|
|
manPages = docs.manPages;
|
2018-05-06 20:14:50 +00:00
|
|
|
|
2020-02-01 23:39:17 +00:00
|
|
|
manual = { inherit (docs) html htmlOpenTool; };
|
2018-05-06 20:14:50 +00:00
|
|
|
}
|