diff --git a/lib/options.nix b/lib/options.nix index 38f4f1329f212..ba3ead655c61a 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -69,6 +69,16 @@ rec { type = lib.types.bool; }; + /* Like mkEnableOption but defaulting to true. */ + mkEnabledOption = + # Name for the created option + name: mkOption { + default = true; + example = false; + description = "Whether to enable ${name}."; + type = lib.types.bool; + }; + /* This option accepts anything, but it does not produce any result. This is useful for sharing a module across different module sets