2018-12-18 18:09:56 +01:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
2017-01-15 20:56:18 +01:00
|
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
2018-05-18 23:18:12 +02:00
|
|
|
|
cfg = config.manual;
|
|
|
|
|
|
2021-08-17 19:28:04 +02:00
|
|
|
|
docs = import ../docs { inherit lib pkgs; };
|
2018-05-18 23:18:12 +02:00
|
|
|
|
|
2022-06-16 14:13:06 +02:00
|
|
|
|
in {
|
2017-01-15 20:56:18 +01:00
|
|
|
|
options = {
|
2018-05-18 23:18:12 +02: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 20:56:18 +01: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 09:39:14 +02: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 20:56:18 +01:00
|
|
|
|
};
|
|
|
|
|
|
2018-05-18 23:18:12 +02:00
|
|
|
|
config = {
|
|
|
|
|
home.packages = mkMerge [
|
2018-12-18 18:09:56 +01: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 23:18:12 +02:00
|
|
|
|
];
|
2019-08-28 20:36:11 +02: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 20:56:18 +01:00
|
|
|
|
};
|
2017-07-21 21:10:32 +02:00
|
|
|
|
|
2017-01-15 20:56:18 +01:00
|
|
|
|
}
|