lib/options: Add mkEnabledOption

Like `lib.options.mkEnableOption` but it's enabled by default
This commit is contained in:
Firelight Flagboy 2025-02-05 18:30:38 +01:00 committed by Matt Sturgeon
parent 7f2601adc1
commit 56e8230939
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -64,6 +64,16 @@ in
rec {
inherit pluginDefaultText;
# Create an option declaration with a default value of `true`, and can be defined to `false`.
mkEnabledOption =
name:
lib.mkOption {
default = true;
example = false;
description = "Whether to enable ${name}.";
type = types.bool;
};
# Creates an option with a nullable type that defaults to null.
mkNullOrOption' =
{