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;
|
2023-07-01 23:45:18 +00:00
|
|
|
|
description = ''
|
2018-05-18 21:18:12 +00:00
|
|
|
|
Whether to install the HTML manual. This also installs the
|
2023-06-30 23:30:13 +00:00
|
|
|
|
{command}`home-manager-help` tool, which opens a local
|
2018-05-18 21:18:12 +00:00
|
|
|
|
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;
|
2023-07-01 23:45:18 +00:00
|
|
|
|
description = ''
|
2017-01-15 19:56:18 +00:00
|
|
|
|
Whether to install the configuration manual page. The manual can
|
2023-06-30 23:30:13 +00:00
|
|
|
|
be reached by {command}`man home-configuration.nix`.
|
|
|
|
|
|
2017-01-15 19:56:18 +00:00
|
|
|
|
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;
|
2023-07-01 23:45:18 +00:00
|
|
|
|
description = ''
|
2019-04-13 07:39:14 +00:00
|
|
|
|
Whether to install a JSON formatted list of all Home Manager
|
|
|
|
|
options. This can be located at
|
2023-06-30 23:30:13 +00:00
|
|
|
|
{file}`<profile directory>/share/doc/home-manager/options.json`,
|
2019-04-13 07:39:14 +00:00
|
|
|
|
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
|
|
|
|
}
|