2020-04-24 23:36:52 +00:00
|
|
|
# TODO check that no license information gets lost
|
2021-08-10 14:31:46 +00:00
|
|
|
{ callPackage, config, lib, vimUtils, vim, darwin, llvmPackages, luaPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
inherit (vimUtils.override {inherit vim;}) buildVimPluginFrom2Nix vimGenDocHook;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
inherit (lib) extends;
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
initialPackages = self: {
|
|
|
|
# Convert derivation to a vim plugin.
|
|
|
|
toVimPlugin = drv:
|
|
|
|
drv.overrideAttrs(oldAttrs: {
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ vimGenDocHook ];
|
2021-08-10 14:31:46 +00:00
|
|
|
passthru = (oldAttrs.passthru or {}) // {
|
|
|
|
vimPlugin = true;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
plugins = callPackage ./generated.nix {
|
2021-05-20 23:08:51 +00:00
|
|
|
inherit buildVimPluginFrom2Nix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# 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;
|
2021-08-10 14:31:46 +00:00
|
|
|
inherit llvmPackages luaPackages;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
aliases = if (config.allowAliases or true) then (import ./aliases.nix lib) else final: prev: {};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
extensible-self = lib.makeExtensible
|
|
|
|
(extends aliases
|
|
|
|
(extends overrides
|
|
|
|
(extends plugins initialPackages)
|
|
|
|
)
|
|
|
|
);
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
2021-05-20 23:08:51 +00:00
|
|
|
extensible-self
|