lib/options: add mkNullable' variant

This commit is contained in:
Matt Sturgeon 2024-05-31 19:18:58 +01:00
parent ed56221499
commit 84b2b0d90c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -127,9 +127,18 @@ rec {
${defaultDesc}
'';
mkNullable' =
{ default, description, ... }@args:
mkNullOrOption' (
args
// {
default = null;
description = mkDesc default description;
}
);
mkNullable =
type: default: desc:
mkNullOrOption type (mkDesc default desc);
type: default: description:
mkNullable' { inherit type default description; };
mkNullableWithRaw = type: mkNullable (nixvimTypes.maybeRaw type);