From 06f9f423e953dcb64cef8961299d17643ad0d9d6 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 7 May 2021 17:04:18 +0200 Subject: [PATCH] modules: documentation: use 'mkDisableOption' The documentation module already gates behind 'documentation.enable' for the other options. --- modules/documentation.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/modules/documentation.nix b/modules/documentation.nix index 5f67197..093c4cd 100644 --- a/modules/documentation.nix +++ b/modules/documentation.nix @@ -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 = {