helpers: add a helper for creating options

This commit is contained in:
Pedro Alves 2021-02-10 21:03:30 +00:00
parent a9402c953a
commit 43ce0d77db

View file

@ -51,4 +51,11 @@ rec {
key = key;
mode = mode;
}) normalized);
# Creates an option with a nullable type that defaults to null.
nullOrOption = type: desc: lib.mkOption {
type = lib.types.nullOr type;
default = null;
description = desc;
};
}