2018-12-18 17:09:56 +00:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
2017-01-15 19:56:18 +00:00
|
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
2018-05-18 21:18:12 +00:00
|
|
|
|
cfg = config.manual;
|
|
|
|
|
|
2023-06-28 21:55:00 +00:00
|
|
|
|
docs = import ../docs {
|
|
|
|
|
inherit pkgs lib;
|
|
|
|
|
inherit (config.home.version) release isReleaseBranch;
|
|
|
|
|
};
|
2018-05-18 21:18:12 +00:00
|
|
|
|
|
2022-06-16 12:13:06 +00:00
|
|
|
|
in {
|
2017-01-15 19:56:18 +00:00
|
|
|
|
options = {
|
2018-05-18 21:18:12 +00:00
|
|
|
|
manual.html.enable = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = false;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether to install the HTML manual. This also installs the
|
|
|
|
|
<command>home-manager-help</command> tool, which opens a local
|
|
|
|
|
copy of the Home Manager manual in the system web browser.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
2017-01-15 19:56:18 +00:00
|
|
|
|
manual.manpages.enable = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = true;
|
|
|
|
|
example = false;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether to install the configuration manual page. The manual can
|
|
|
|
|
be reached by <command>man home-configuration.nix</command>.
|
|
|
|
|
</para><para>
|
|
|
|
|
When looking at the manual page pretend that all references to
|
|
|
|
|
NixOS stuff are actually references to Home Manager stuff.
|
|
|
|
|
Thanks!
|
|
|
|
|
'';
|
|
|
|
|
};
|
2019-04-13 07:39:14 +00:00
|
|
|
|
|
|
|
|
|
manual.json.enable = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = false;
|
|
|
|
|
example = true;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether to install a JSON formatted list of all Home Manager
|
|
|
|
|
options. This can be located at
|
|
|
|
|
<filename><profile directory>/share/doc/home-manager/options.json</filename>,
|
|
|
|
|
and may be used for navigating definitions, auto-completing,
|
|
|
|
|
and other miscellaneous tasks.
|
|
|
|
|
'';
|
|
|
|
|
};
|
2017-01-15 19:56:18 +00:00
|
|
|
|
};
|
|
|
|
|
|
2018-05-18 21:18:12 +00:00
|
|
|
|
config = {
|
|
|
|
|
home.packages = mkMerge [
|
2018-12-18 17:09:56 +00:00
|
|
|
|
(mkIf cfg.html.enable [ docs.manual.html docs.manual.htmlOpenTool ])
|
|
|
|
|
(mkIf cfg.manpages.enable [ docs.manPages ])
|
|
|
|
|
(mkIf cfg.json.enable [ docs.options.json ])
|
2018-05-18 21:18:12 +00:00
|
|
|
|
];
|
2019-08-28 18:36:11 +00:00
|
|
|
|
|
|
|
|
|
# Whether a dependency on nmd should be introduced.
|
|
|
|
|
home.extraBuilderCommands =
|
|
|
|
|
mkIf (cfg.html.enable || cfg.manpages.enable || cfg.json.enable) ''
|
|
|
|
|
mkdir $out/lib
|
|
|
|
|
ln -s ${docs.nmdSrc} $out/lib/nmd
|
|
|
|
|
'';
|
2017-01-15 19:56:18 +00:00
|
|
|
|
};
|
2017-07-21 19:10:32 +00:00
|
|
|
|
|
2017-01-15 19:56:18 +00:00
|
|
|
|
}
|