lib/options: introduce new mkPackageOption for dependencies

This commit is contained in:
Gaetan Lepage 2024-05-17 14:39:55 +02:00 committed by Gaétan Lepage
parent 26367692da
commit 7c4fe30f81
15 changed files with 51 additions and 85 deletions

View file

@ -155,6 +155,26 @@ rec {
mkNullable nixvimTypes.highlight default (if desc == "" then "Highlight settings." else desc);
};
mkPackageOption =
{
name ? null, # Can be null if a custom description is given.
default,
description ? null,
example ? null,
}:
mkOption {
type = with types; nullOr package;
inherit default example;
description =
if description == null then
''
Which package to use for `${name}`.
Set to `null` to disable its automatic installation.
''
else
description;
};
mkPluginPackageOption =
name: default:
mkOption {