mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-13 09:17:07 +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
@ -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 // {
|
||||
|
Loading…
Reference in New Issue
Block a user