mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/options: Add mkEnabledOption
Like `lib.options.mkEnableOption` but it's enabled by default
This commit is contained in:
parent
7f2601adc1
commit
56e8230939
1 changed files with 10 additions and 0 deletions
|
@ -64,6 +64,16 @@ in
|
||||||
rec {
|
rec {
|
||||||
inherit pluginDefaultText;
|
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.
|
# Creates an option with a nullable type that defaults to null.
|
||||||
mkNullOrOption' =
|
mkNullOrOption' =
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue