mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/plugins: introduce mkMetaModule
This commit is contained in:
parent
e908e344f4
commit
1a5f1b4393
3 changed files with 47 additions and 20 deletions
|
@ -82,4 +82,33 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
Produce a module that defines a plugin's metadata.
|
||||
*/
|
||||
mkMetaModule =
|
||||
{
|
||||
loc,
|
||||
maintainers,
|
||||
description,
|
||||
url ? null,
|
||||
}@args:
|
||||
{ options, ... }:
|
||||
let
|
||||
opts = lib.getAttrFromPath loc options;
|
||||
url =
|
||||
if args.url or null == null then
|
||||
opts.package.default.meta.homepage or (throw "unable to get URL for `${lib.showOption loc}`.")
|
||||
else
|
||||
args.url;
|
||||
in
|
||||
{
|
||||
meta = {
|
||||
inherit maintainers;
|
||||
nixvimInfo = {
|
||||
inherit description url;
|
||||
path = loc;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue