2020-10-12 00:22:58 +00:00
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
|
|
cfg = config.manual;
|
|
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
|
docs = import ../docs {
|
|
|
|
|
inherit pkgs lib;
|
|
|
|
|
inherit (config.home.version) release isReleaseBranch;
|
|
|
|
|
};
|
2020-10-12 00:22:58 +00:00
|
|
|
|
|
2023-01-10 09:35:00 +00:00
|
|
|
|
in {
|
2020-10-12 00:22:58 +00:00
|
|
|
|
options = {
|
|
|
|
|
manual.html.enable = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = false;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether to install the HTML manual. This also installs the
|
2023-08-08 10:19:01 +00:00
|
|
|
|
{command}`home-manager-help` tool, which opens a local
|
2020-10-12 00:22:58 +00:00
|
|
|
|
copy of the Home Manager manual in the system web browser.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
manual.manpages.enable = mkOption {
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = true;
|
|
|
|
|
example = false;
|
|
|
|
|
description = ''
|
|
|
|
|
Whether to install the configuration manual page. The manual can
|
2023-08-08 10:19:01 +00:00
|
|
|
|
be reached by {command}`man home-configuration.nix`.
|
|
|
|
|
|
2020-10-12 00:22:58 +00:00
|
|
|
|
When looking at the manual page pretend that all references to
|
|
|
|
|
NixOS stuff are actually references to Home Manager stuff.
|
|
|
|
|
Thanks!
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
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
|
2023-08-08 10:19:01 +00:00
|
|
|
|
{file}`<profile directory>/share/doc/home-manager/options.json`,
|
2020-10-12 00:22:58 +00:00
|
|
|
|
and may be used for navigating definitions, auto-completing,
|
|
|
|
|
and other miscellaneous tasks.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
|
home.packages = mkMerge [
|
|
|
|
|
(mkIf cfg.html.enable [ docs.manual.html docs.manual.htmlOpenTool ])
|
|
|
|
|
(mkIf cfg.manpages.enable [ docs.manPages ])
|
|
|
|
|
(mkIf cfg.json.enable [ docs.options.json ])
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|