nixpkgs-suyu/pkgs/misc/vim-plugins/default.nix
Matthieu Coudron 06684792fb vimPlugins.plenary: init from lua package
This commit shows how to convert luarocks packages into (neo)vim ones.
The advantage for neovim lua plugins to register their rockspec (aka
package definition) is that the plugin can express its dependencies and
a few metadata through it.
2021-08-09 21:23:29 +02:00

45 lines
1.2 KiB
Nix

# TODO check that no license information gets lost
{ callPackage, config, lib, vimUtils, vim, darwin, llvmPackages, luaPackages }:
let
inherit (vimUtils.override {inherit vim;}) buildVimPluginFrom2Nix;
inherit (lib) extends;
initialPackages = self: {
# Convert derivation to a vim plugin.
toVimPlugin = drv:
drv.overrideAttrs(oldAttrs: {
passthru = (oldAttrs.passthru or {}) // {
vimPlugin = true;
};
});
};
plugins = callPackage ./generated.nix {
inherit buildVimPluginFrom2Nix;
};
# TL;DR
# * Add your plugin to ./vim-plugin-names
# * run ./update.py
#
# If additional modifications to the build process are required,
# add to ./overrides.nix.
overrides = callPackage ./overrides.nix {
inherit (darwin.apple_sdk.frameworks) Cocoa CoreFoundation CoreServices;
inherit buildVimPluginFrom2Nix;
inherit llvmPackages luaPackages;
};
aliases = if (config.allowAliases or true) then (import ./aliases.nix lib) else final: prev: {};
extensible-self = lib.makeExtensible
(extends aliases
(extends overrides
(extends plugins initialPackages)
)
);
in
extensible-self