Create a mkEnableOption function for an extremely common NixOS idiom

Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
Shea Levy 2013-07-18 15:13:42 -04:00
parent 0c3b84c850
commit 6b0d6593e8

View file

@ -28,6 +28,13 @@ rec {
# extraConfigs (list of possible configurations)
};
mkEnableOption = name: mkOption {
default = false;
example = true;
description = "Whether to enable ${name}";
type = lib.types.bool;
};
mapSubOptions = f: opt:
if opt ? options then
opt // {