mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 08:53:28 +02:00
lib/options: make mkPackageOption
use mkNullOrOption'
This commit is contained in:
parent
1bb4cb9c6c
commit
297aa6d0a2
1 changed files with 18 additions and 16 deletions
|
@ -248,23 +248,25 @@ rec {
|
||||||
|
|
||||||
mkPackageOption =
|
mkPackageOption =
|
||||||
{
|
{
|
||||||
name ? null, # Can be null if a custom description is given.
|
name ? null, # Can be omitted if a custom description is given.
|
||||||
default,
|
|
||||||
description ? null,
|
description ? null,
|
||||||
example ? null,
|
default, # `default` is not optional
|
||||||
}:
|
...
|
||||||
mkOption {
|
}@args:
|
||||||
type = with types; nullOr package;
|
mkNullOrOption' (
|
||||||
inherit default example;
|
(filterAttrs (n: _: n != "name") args)
|
||||||
description =
|
// {
|
||||||
if description == null then
|
type = types.package;
|
||||||
''
|
description =
|
||||||
Which package to use for `${name}`.
|
if description == null then
|
||||||
Set to `null` to disable its automatic installation.
|
''
|
||||||
''
|
Which package to use for `${name}`.
|
||||||
else
|
Set to `null` to disable its automatic installation.
|
||||||
description;
|
''
|
||||||
};
|
else
|
||||||
|
description;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
mkPluginPackageOption =
|
mkPluginPackageOption =
|
||||||
name: default:
|
name: default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue