mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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 =
|
||||
{
|
||||
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;
|
||||
description =
|
||||
if description == null then
|
||||
''
|
||||
Which package to use for `${name}`.
|
||||
Set to `null` to disable its automatic installation.
|
||||
''
|
||||
else
|
||||
description;
|
||||
};
|
||||
default, # `default` is not optional
|
||||
...
|
||||
}@args:
|
||||
mkNullOrOption' (
|
||||
(filterAttrs (n: _: n != "name") args)
|
||||
// {
|
||||
type = types.package;
|
||||
description =
|
||||
if description == null then
|
||||
''
|
||||
Which package to use for `${name}`.
|
||||
Set to `null` to disable its automatic installation.
|
||||
''
|
||||
else
|
||||
description;
|
||||
}
|
||||
);
|
||||
|
||||
mkPluginPackageOption =
|
||||
name: default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue