modules: documentation: use 'mkDisableOption'

The documentation module already gates behind 'documentation.enable' for
the other options.
This commit is contained in:
Bruno BELANYI 2021-05-07 17:04:18 +02:00
parent ad1d907c25
commit 06f9f423e9

View file

@ -1,23 +1,18 @@
{ config, lib, ... }:
let
cfg = config.my.module.documentation;
# I usually want everything enabled at once, but keep it customizable
defaultToGlobal = description: lib.mkEnableOption description // {
default = cfg.enable;
};
in
{
options.my.module.documentation = with lib.my; {
enable = mkDisableOption "Documentation integration";
dev.enable = defaultToGlobal "Documentation aimed at developers";
dev.enable = mkDisableOption "Documentation aimed at developers";
info.enable = defaultToGlobal "Documentation aimed at developers";
info.enable = mkDisableOption "Documentation aimed at developers";
man.enable = defaultToGlobal "Documentation aimed at developers";
man.enable = mkDisableOption "Documentation aimed at developers";
nixos.enable = defaultToGlobal "NixOS documentation";
nixos.enable = mkDisableOption "NixOS documentation";
};
config.documentation = {