mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
Create a mkEnableOption function for an extremely common NixOS idiom
Signed-off-by: Shea Levy <shea@shealevy.com>
This commit is contained in:
parent
0c3b84c850
commit
6b0d6593e8
1 changed files with 7 additions and 0 deletions
|
@ -28,6 +28,13 @@ rec {
|
||||||
# extraConfigs (list of possible configurations)
|
# extraConfigs (list of possible configurations)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkEnableOption = name: mkOption {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
description = "Whether to enable ${name}";
|
||||||
|
type = lib.types.bool;
|
||||||
|
};
|
||||||
|
|
||||||
mapSubOptions = f: opt:
|
mapSubOptions = f: opt:
|
||||||
if opt ? options then
|
if opt ? options then
|
||||||
opt // {
|
opt // {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue