mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib: Harmonize package options which may not exist in nixpkgs
This commit is contained in:
parent
eb611349a7
commit
a2f01876f7
6 changed files with 57 additions and 42 deletions
|
@ -37,7 +37,8 @@ in
|
|||
{
|
||||
meta.nixvimInfo = {
|
||||
# TODO: description
|
||||
url = args.url or opts.package.default.meta.homepage or null;
|
||||
# The package default can throw when the server is unpackaged, so use tryEval
|
||||
url = args.url or (builtins.tryEval opts.package.default).value.meta.homepage or null;
|
||||
path = [
|
||||
"plugins"
|
||||
"lsp"
|
||||
|
@ -51,21 +52,8 @@ in
|
|||
enable = lib.mkEnableOption description;
|
||||
|
||||
package =
|
||||
if lib.isOption package then
|
||||
package
|
||||
else if args ? package then
|
||||
lib.mkPackageOption pkgs name {
|
||||
nullable = true;
|
||||
default = package;
|
||||
}
|
||||
else
|
||||
# If we're not provided a package, we should provide a no-default option
|
||||
lib.mkOption {
|
||||
type = types.nullOr types.package;
|
||||
description = ''
|
||||
The package to use for ${name}. Has no default, but can be set to null.
|
||||
'';
|
||||
};
|
||||
lib.nixvim.mkMaybeUnpackagedOption "plugins.lsp.servers.${name}.package" pkgs name
|
||||
package;
|
||||
|
||||
cmd = mkOption {
|
||||
type = with types; nullOr (listOf str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue