vimPlugins: inherit lua & node packages before overrides (#390702)
This commit is contained in:
@@ -24,6 +24,11 @@ let
|
||||
inherit (neovimUtils) buildNeovimPlugin;
|
||||
};
|
||||
|
||||
extras = callPackage ./extras.nix {
|
||||
inherit buildVimPlugin;
|
||||
inherit (neovimUtils) buildNeovimPlugin;
|
||||
};
|
||||
|
||||
# TL;DR
|
||||
# * Add your plugin to ./vim-plugin-names
|
||||
# * run ./update.py
|
||||
@@ -36,9 +41,11 @@ let
|
||||
};
|
||||
|
||||
aliases = if config.allowAliases then (import ./aliases.nix lib) else final: prev: { };
|
||||
|
||||
extensible-self = lib.makeExtensible (
|
||||
extends aliases (extends overrides (extends plugins initialPackages))
|
||||
);
|
||||
in
|
||||
extensible-self
|
||||
lib.pipe initialPackages [
|
||||
(extends plugins)
|
||||
(extends extras)
|
||||
(extends overrides)
|
||||
(extends aliases)
|
||||
lib.makeExtensible
|
||||
]
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
{
|
||||
lib,
|
||||
buildVimPlugin,
|
||||
buildNeovimPlugin,
|
||||
nodePackages,
|
||||
neovim-unwrapped,
|
||||
}:
|
||||
let
|
||||
luaPackages = neovim-unwrapped.lua.pkgs;
|
||||
in
|
||||
self: super:
|
||||
(
|
||||
let
|
||||
nodePackageNames = [
|
||||
"coc-cmake"
|
||||
"coc-docker"
|
||||
"coc-emmet"
|
||||
"coc-eslint"
|
||||
"coc-explorer"
|
||||
"coc-flutter"
|
||||
"coc-git"
|
||||
"coc-go"
|
||||
"coc-haxe"
|
||||
"coc-highlight"
|
||||
"coc-html"
|
||||
"coc-java"
|
||||
"coc-jest"
|
||||
"coc-json"
|
||||
"coc-lists"
|
||||
"coc-ltex"
|
||||
"coc-markdownlint"
|
||||
"coc-pairs"
|
||||
"coc-prettier"
|
||||
"coc-r-lsp"
|
||||
"coc-rls"
|
||||
"coc-rust-analyzer"
|
||||
"coc-sh"
|
||||
"coc-smartf"
|
||||
"coc-snippets"
|
||||
"coc-solargraph"
|
||||
"coc-spell-checker"
|
||||
"coc-sqlfluff"
|
||||
"coc-stylelint"
|
||||
"coc-sumneko-lua"
|
||||
"coc-tabnine"
|
||||
"coc-texlab"
|
||||
"coc-tsserver"
|
||||
"coc-ultisnips"
|
||||
"coc-vetur"
|
||||
"coc-vimlsp"
|
||||
"coc-vimtex"
|
||||
"coc-wxml"
|
||||
"coc-yaml"
|
||||
"coc-yank"
|
||||
];
|
||||
nodePackage2VimPackage =
|
||||
name:
|
||||
buildVimPlugin {
|
||||
pname = name;
|
||||
inherit (nodePackages.${name}) version meta;
|
||||
src = "${nodePackages.${name}}/lib/node_modules/${name}";
|
||||
};
|
||||
in
|
||||
lib.genAttrs nodePackageNames nodePackage2VimPackage
|
||||
)
|
||||
// (
|
||||
let
|
||||
luarocksPackageNames = [
|
||||
"fidget-nvim"
|
||||
"gitsigns-nvim"
|
||||
"image-nvim"
|
||||
"lsp-progress-nvim"
|
||||
"lualine-nvim"
|
||||
"luasnip"
|
||||
"lush-nvim"
|
||||
"lz-n"
|
||||
"lze"
|
||||
"lzextras"
|
||||
"lzn-auto-require"
|
||||
"middleclass"
|
||||
"mini-test"
|
||||
"neorg"
|
||||
"neotest"
|
||||
"nui-nvim"
|
||||
"nvim-cmp"
|
||||
"nvim-nio"
|
||||
"nvim-web-devicons"
|
||||
"oil-nvim"
|
||||
"orgmode"
|
||||
"papis-nvim"
|
||||
"rest-nvim"
|
||||
"rocks-config-nvim"
|
||||
"rtp-nvim"
|
||||
"telescope-manix"
|
||||
"telescope-nvim"
|
||||
];
|
||||
toVimPackage =
|
||||
name:
|
||||
buildNeovimPlugin {
|
||||
luaAttr = luaPackages.${name};
|
||||
};
|
||||
in
|
||||
lib.genAttrs luarocksPackageNames toVimPackage
|
||||
)
|
||||
@@ -1281,6 +1281,7 @@ in
|
||||
dependencies = [ self.plenary-nvim ];
|
||||
};
|
||||
|
||||
# NOTE: this overrides a luaPackages-based plugin
|
||||
gitsigns-nvim = super.gitsigns-nvim.overrideAttrs {
|
||||
dependencies = [ self.plenary-nvim ];
|
||||
};
|
||||
@@ -1421,6 +1422,7 @@ in
|
||||
doInstallCheck = true;
|
||||
};
|
||||
|
||||
# NOTE: this overrides a luaPackages-based plugin
|
||||
image-nvim = super.image-nvim.overrideAttrs {
|
||||
dependencies = with self; [
|
||||
nvim-treesitter
|
||||
@@ -1683,6 +1685,7 @@ in
|
||||
dependencies = [ self.lualine-nvim ];
|
||||
};
|
||||
|
||||
# NOTE: this overrides a luaPackages-based plugin
|
||||
luasnip = super.luasnip.overrideAttrs {
|
||||
dependencies = [ luaPackages.jsregexp ];
|
||||
};
|
||||
@@ -1949,6 +1952,7 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
# NOTE: this overrides a luaPackages-based plugin
|
||||
neotest = super.neotest.overrideAttrs {
|
||||
dependencies = with self; [
|
||||
nvim-nio
|
||||
@@ -2838,6 +2842,7 @@ in
|
||||
};
|
||||
|
||||
# needs "http" and "json" treesitter grammars too
|
||||
# NOTE: this overrides a luaPackages-based plugin
|
||||
rest-nvim = super.rest-nvim.overrideAttrs {
|
||||
dependencies = with self; [
|
||||
plenary-nvim
|
||||
@@ -3225,6 +3230,7 @@ in
|
||||
dependencies = [ self.plenary-nvim ];
|
||||
};
|
||||
|
||||
# NOTE: this overrides a luaPackages-based plugin
|
||||
telescope-nvim = super.telescope-nvim.overrideAttrs {
|
||||
dependencies = [ self.plenary-nvim ];
|
||||
};
|
||||
@@ -3988,101 +3994,6 @@ in
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
||||
// (
|
||||
let
|
||||
nodePackageNames = [
|
||||
"coc-cmake"
|
||||
"coc-docker"
|
||||
"coc-emmet"
|
||||
"coc-eslint"
|
||||
"coc-explorer"
|
||||
"coc-flutter"
|
||||
"coc-git"
|
||||
"coc-go"
|
||||
"coc-haxe"
|
||||
"coc-highlight"
|
||||
"coc-html"
|
||||
"coc-java"
|
||||
"coc-jest"
|
||||
"coc-json"
|
||||
"coc-lists"
|
||||
"coc-ltex"
|
||||
"coc-markdownlint"
|
||||
"coc-pairs"
|
||||
"coc-prettier"
|
||||
"coc-r-lsp"
|
||||
"coc-rls"
|
||||
"coc-rust-analyzer"
|
||||
"coc-sh"
|
||||
"coc-smartf"
|
||||
"coc-snippets"
|
||||
"coc-solargraph"
|
||||
"coc-spell-checker"
|
||||
"coc-sqlfluff"
|
||||
"coc-stylelint"
|
||||
"coc-sumneko-lua"
|
||||
"coc-tabnine"
|
||||
"coc-texlab"
|
||||
"coc-tsserver"
|
||||
"coc-ultisnips"
|
||||
"coc-vetur"
|
||||
"coc-vimlsp"
|
||||
"coc-vimtex"
|
||||
"coc-wxml"
|
||||
"coc-yaml"
|
||||
"coc-yank"
|
||||
];
|
||||
nodePackage2VimPackage =
|
||||
name:
|
||||
buildVimPlugin {
|
||||
pname = name;
|
||||
inherit (nodePackages.${name}) version meta;
|
||||
src = "${nodePackages.${name}}/lib/node_modules/${name}";
|
||||
};
|
||||
in
|
||||
lib.genAttrs nodePackageNames nodePackage2VimPackage
|
||||
)
|
||||
// (
|
||||
let
|
||||
luarocksPackageNames = [
|
||||
"fidget-nvim"
|
||||
"gitsigns-nvim"
|
||||
"image-nvim"
|
||||
"lsp-progress-nvim"
|
||||
"lualine-nvim"
|
||||
"luasnip"
|
||||
"lush-nvim"
|
||||
"lz-n"
|
||||
"lze"
|
||||
"lzextras"
|
||||
"lzn-auto-require"
|
||||
"middleclass"
|
||||
"mini-test"
|
||||
"neorg"
|
||||
"neotest"
|
||||
"nui-nvim"
|
||||
"nvim-cmp"
|
||||
"nvim-nio"
|
||||
"nvim-web-devicons"
|
||||
"oil-nvim"
|
||||
"orgmode"
|
||||
"papis-nvim"
|
||||
"rest-nvim"
|
||||
"rocks-config-nvim"
|
||||
"rtp-nvim"
|
||||
"telescope-manix"
|
||||
"telescope-nvim"
|
||||
];
|
||||
toVimPackage =
|
||||
name:
|
||||
neovimUtils.buildNeovimPlugin {
|
||||
luaAttr = luaPackages.${name};
|
||||
};
|
||||
in
|
||||
lib.genAttrs luarocksPackageNames toVimPackage
|
||||
)
|
||||
// {
|
||||
|
||||
rocks-nvim =
|
||||
(neovimUtils.buildNeovimPlugin {
|
||||
|
||||
Reference in New Issue
Block a user