lib/options: make mkPackageOption use mkNullOrOption'

This commit is contained in:
Matt Sturgeon 2024-05-31 17:28:31 +01:00
parent 1bb4cb9c6c
commit 297aa6d0a2
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -248,14 +248,15 @@ rec {
mkPackageOption =
{
name ? null, # Can be null if a custom description is given.
default,
name ? null, # Can be omitted if a custom description is given.
description ? null,
example ? null,
}:
mkOption {
type = with types; nullOr package;
inherit default example;
default, # `default` is not optional
...
}@args:
mkNullOrOption' (
(filterAttrs (n: _: n != "name") args)
// {
type = types.package;
description =
if description == null then
''
@ -264,7 +265,8 @@ rec {
''
else
description;
};
}
);
mkPluginPackageOption =
name: default: