39 lines
759 B
Nix
39 lines
759 B
Nix
{lib}: {
|
|
## Quickly enable an option.
|
|
##
|
|
## ```nix
|
|
## services.nginx = enabled;
|
|
## ```
|
|
##
|
|
#@ true
|
|
enabled = {
|
|
enable = true;
|
|
};
|
|
|
|
## Quickly disable an option.
|
|
##
|
|
## ```nix
|
|
## services.nginx = enabled;
|
|
## ```
|
|
##
|
|
#@ false
|
|
disabled = {
|
|
enable = false;
|
|
};
|
|
|
|
## Like lib.mkEnableOption, but allows specifying the default.
|
|
##
|
|
## ```nix
|
|
## options.marleyos.wayland = mkEnableOption' "wayland" false;
|
|
## ```
|
|
mkEnableOption' = name: default:
|
|
lib.mkOption {
|
|
inherit default;
|
|
example = true;
|
|
description =
|
|
if name ? _type && name._type == "mdDoc"
|
|
then lib.mdDoc "Whether to enable ${name.text}."
|
|
else "Whether to enable ${name}.";
|
|
type = lib.types.bool;
|
|
};
|
|
}
|