vimPlugins: strictly enforce only overrides in overrides.nix (#438906)
This commit is contained in:
@@ -125,6 +125,7 @@ mapAliases (
|
||||
surround = vim-surround;
|
||||
sleuth = vim-sleuth;
|
||||
solidity = vim-solidity;
|
||||
ssr = ssr-nvim; # Added 2025-08-31
|
||||
stylish-haskell = vim-stylish-haskell;
|
||||
stylishHaskell = vim-stylish-haskell; # backwards compat, added 2014-10-18
|
||||
suda-vim = vim-suda; # backwards compat, added 2024-05-16
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
symlinkJoin,
|
||||
}:
|
||||
final: prev: {
|
||||
|
||||
corePlugins = symlinkJoin {
|
||||
name = "core-vim-plugins";
|
||||
paths = with final; [
|
||||
# plugin managers
|
||||
lazy-nvim
|
||||
mini-deps
|
||||
packer-nvim
|
||||
vim-plug
|
||||
|
||||
# core dependencies
|
||||
plenary-nvim
|
||||
|
||||
# popular plugins
|
||||
mini-nvim
|
||||
nvim-cmp
|
||||
nvim-lspconfig
|
||||
nvim-treesitter
|
||||
vim-airline
|
||||
vim-fugitive
|
||||
vim-surround
|
||||
];
|
||||
|
||||
meta.description = "Collection of popular vim plugins (for internal testing purposes)";
|
||||
};
|
||||
|
||||
}
|
||||
@@ -48,6 +48,8 @@ let
|
||||
inherit (neovimUtils) buildNeovimPlugin;
|
||||
};
|
||||
|
||||
corePlugins = callPackage ./corePlugins.nix { };
|
||||
|
||||
# TL;DR
|
||||
# * Add your plugin to ./vim-plugin-names
|
||||
# * run ./update.py
|
||||
@@ -66,6 +68,7 @@ lib.pipe initialPackages [
|
||||
(extends luaPackagePlugins)
|
||||
(extends nodePackagePlugins)
|
||||
(extends nonGeneratedPlugins)
|
||||
(extends corePlugins)
|
||||
(extends overrides)
|
||||
(extends aliases)
|
||||
lib.makeExtensible
|
||||
|
||||
@@ -9,8 +9,10 @@ let
|
||||
|
||||
luarocksPackageNames = [
|
||||
"fidget-nvim"
|
||||
"fzf-lua"
|
||||
"gitsigns-nvim"
|
||||
"grug-far-nvim"
|
||||
"haskell-tools-nvim"
|
||||
"image-nvim"
|
||||
"lsp-progress-nvim"
|
||||
"lualine-nvim"
|
||||
@@ -34,6 +36,8 @@ let
|
||||
"plenary-nvim"
|
||||
"rest-nvim"
|
||||
"rocks-config-nvim"
|
||||
"rocks-nvim"
|
||||
"rustaceanvim"
|
||||
"rtp-nvim"
|
||||
"telescope-manix"
|
||||
"telescope-nvim"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ notmuch }: notmuch.vim
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
lib,
|
||||
vimPlugins,
|
||||
}:
|
||||
lib.recurseIntoAttrs vimPlugins.nvim-treesitter.grammarPlugins
|
||||
@@ -0,0 +1 @@
|
||||
{ parinfer-rust }: parinfer-rust
|
||||
@@ -7,9 +7,7 @@
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
fetchurl,
|
||||
neovimUtils,
|
||||
replaceVars,
|
||||
symlinkJoin,
|
||||
# Language dependencies
|
||||
fetchYarnDeps,
|
||||
mkYarnModules,
|
||||
@@ -35,10 +33,8 @@
|
||||
neovim-unwrapped,
|
||||
nim1,
|
||||
nodejs,
|
||||
notmuch,
|
||||
openscad,
|
||||
openssh,
|
||||
parinfer-rust,
|
||||
ranger,
|
||||
ripgrep,
|
||||
sqlite,
|
||||
@@ -64,7 +60,6 @@
|
||||
codeium,
|
||||
# command-t dependencies
|
||||
getconf,
|
||||
ruby,
|
||||
# cornelis dependencies
|
||||
cornelis,
|
||||
# cpsm dependencies
|
||||
@@ -108,7 +103,6 @@
|
||||
# hurl dependencies
|
||||
hurl,
|
||||
# must be lua51Packages
|
||||
luajitPackages,
|
||||
aider-chat,
|
||||
# typst-preview dependencies
|
||||
tinymist,
|
||||
@@ -131,42 +125,22 @@ self: super:
|
||||
let
|
||||
luaPackages = neovim-unwrapped.lua.pkgs;
|
||||
|
||||
# Ensure the vim plugin builders are not used in this file.
|
||||
# If they are used, these stubs will throw.
|
||||
buildVimPlugin = throw "New plugin definitions should be done outside `overrides.nix`";
|
||||
buildNeoVimPlugin = throw "New plugin definitions should be done outside `overrides.nix`";
|
||||
# Ensures new attributes are not added in this file.
|
||||
assertNoAdditions =
|
||||
overrides:
|
||||
let
|
||||
prevNames = lib.attrNames super;
|
||||
definedNames = lib.attrNames overrides;
|
||||
addedNames = lib.subtractLists prevNames definedNames;
|
||||
in
|
||||
lib.throwIfNot (addedNames == [ ])
|
||||
"vimPlugins: the following attributes should not be defined in overrides.nix:${
|
||||
lib.concatMapStrings (name: "\n- ${name}") addedNames
|
||||
}"
|
||||
overrides;
|
||||
in
|
||||
{
|
||||
corePlugins = symlinkJoin {
|
||||
name = "core-vim-plugins";
|
||||
paths = with self; [
|
||||
# plugin managers
|
||||
lazy-nvim
|
||||
mini-deps
|
||||
packer-nvim
|
||||
vim-plug
|
||||
|
||||
# core dependencies
|
||||
plenary-nvim
|
||||
|
||||
# popular plugins
|
||||
mini-nvim
|
||||
nvim-cmp
|
||||
nvim-lspconfig
|
||||
nvim-treesitter
|
||||
vim-airline
|
||||
vim-fugitive
|
||||
vim-surround
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "Collection of popular vim plugins (for internal testing purposes)";
|
||||
};
|
||||
};
|
||||
|
||||
#######################
|
||||
# Regular overrides
|
||||
|
||||
assertNoAdditions {
|
||||
advanced-git-search-nvim = super.advanced-git-search-nvim.overrideAttrs {
|
||||
checkInputs = with self; [
|
||||
snacks-nvim
|
||||
@@ -1306,8 +1280,7 @@ in
|
||||
dependencies = [ self.plenary-nvim ];
|
||||
};
|
||||
|
||||
fzf-lua = neovimUtils.buildNeovimPlugin {
|
||||
luaAttr = luaPackages.fzf-lua;
|
||||
fzf-lua = super.fzf-lua.overrideAttrs {
|
||||
runtimeDeps = [ fzf ];
|
||||
nvimSkipModules = [
|
||||
"fzf-lua.shell_helper"
|
||||
@@ -1433,10 +1406,9 @@ in
|
||||
dependencies = [ self.luasnip ];
|
||||
};
|
||||
|
||||
haskell-tools-nvim = neovimUtils.buildNeovimPlugin {
|
||||
haskell-tools-nvim = super.haskell-tools-nvim.overrideAttrs {
|
||||
# Optional integrations
|
||||
checkInputs = [ self.telescope-nvim ];
|
||||
luaAttr = luaPackages.haskell-tools-nvim;
|
||||
};
|
||||
|
||||
helm-ls-nvim = super.helm-ls-nvim.overrideAttrs {
|
||||
@@ -2339,8 +2311,6 @@ in
|
||||
NotebookNavigator-nvim = super.NotebookNavigator-nvim.overrideAttrs {
|
||||
};
|
||||
|
||||
notmuch-vim = notmuch.vim;
|
||||
|
||||
nterm-nvim = super.nterm-nvim.overrideAttrs {
|
||||
dependencies = [ self.aniseed ];
|
||||
};
|
||||
@@ -2699,8 +2669,6 @@ in
|
||||
dependencies = [ self.nvim-treesitter ];
|
||||
};
|
||||
|
||||
nvim-treesitter-parsers = lib.recurseIntoAttrs self.nvim-treesitter.grammarPlugins;
|
||||
|
||||
nvim-treesitter-pyfold = super.nvim-treesitter-pyfold.overrideAttrs {
|
||||
dependencies = [ self.nvim-treesitter ];
|
||||
};
|
||||
@@ -2905,8 +2873,6 @@ in
|
||||
dependencies = [ self.nui-nvim ];
|
||||
};
|
||||
|
||||
inherit parinfer-rust;
|
||||
|
||||
parpar-nvim = super.parpar-nvim.overrideAttrs {
|
||||
dependencies = with self; [
|
||||
nvim-parinfer
|
||||
@@ -3091,27 +3057,22 @@ in
|
||||
dependencies = [ self.plenary-nvim ];
|
||||
};
|
||||
|
||||
rocks-nvim =
|
||||
(neovimUtils.buildNeovimPlugin {
|
||||
luaAttr = luaPackages.rocks-nvim;
|
||||
}).overrideAttrs
|
||||
(oa: {
|
||||
passthru = oa.passthru // {
|
||||
initLua = ''
|
||||
vim.g.rocks_nvim = {
|
||||
luarocks_binary = "${neovim-unwrapped.lua.pkgs.luarocks_bootstrap}/bin/luarocks"
|
||||
}
|
||||
'';
|
||||
};
|
||||
rocks-nvim = super.rocks-nvim.overrideAttrs (oa: {
|
||||
passthru = oa.passthru // {
|
||||
initLua = ''
|
||||
vim.g.rocks_nvim = {
|
||||
luarocks_binary = "${neovim-unwrapped.lua.pkgs.luarocks_bootstrap}/bin/luarocks"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
rustaceanvim = neovimUtils.buildNeovimPlugin {
|
||||
rustaceanvim = super.rustaceanvim.overrideAttrs {
|
||||
checkInputs = [
|
||||
# Optional integration
|
||||
self.neotest
|
||||
];
|
||||
luaAttr = luaPackages.rustaceanvim;
|
||||
};
|
||||
|
||||
rust-tools-nvim = super.rust-tools-nvim.overrideAttrs {
|
||||
@@ -3252,7 +3213,7 @@ in
|
||||
}
|
||||
);
|
||||
|
||||
ssr = super.ssr-nvim.overrideAttrs {
|
||||
ssr-nvim = super.ssr-nvim.overrideAttrs {
|
||||
dependencies = [ self.nvim-treesitter ];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user