mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-20 12:42:24 +00:00
1fa84e3e02
so that the hook can be used for lua modules as well. Improves composition.
48 lines
1.3 KiB
Nix
48 lines
1.3 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 vimGenDocHook;
|
|
|
|
inherit (lib) extends;
|
|
|
|
initialPackages = self: {
|
|
# Convert derivation to a vim plugin.
|
|
toVimPlugin = drv:
|
|
drv.overrideAttrs(oldAttrs: {
|
|
|
|
nativeBuildInputs = oldAttrs.nativeBuildInputs or [] ++ [ vimGenDocHook ];
|
|
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
|