modules: documentation: use 'mkDisableOption'
The documentation module already gates behind 'documentation.enable' for the other options.
This commit is contained in:
parent
7e1ca1f3d5
commit
2b6399606a
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue