treewide: Use nixpkgs fetchers for npins

plugins: switch from neodev to lazydev
This commit is contained in:
raf 2025-02-06 17:43:54 +03:00 committed by Gerg-L
commit 8adc4c352a
No known key found for this signature in database
32 changed files with 700 additions and 681 deletions

View file

@ -8,7 +8,6 @@
inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe;
inherit (lib.lists) isList;
inherit (lib.strings) optionalString;
inherit (lib.types) either listOf package str;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
@ -16,6 +15,12 @@
cfg = config.vim.languages.lua;
in {
imports = [
(lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] ''
neodev has been replaced by lazydev
'')
];
options.vim.languages.lua = {
enable = mkEnableOption "Lua language support";
treesitter = {
@ -32,7 +37,7 @@ in {
default = pkgs.lua-language-server;
};
neodev.enable = mkEnableOption "neodev.nvim integration, useful for neovim plugin developers";
lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers";
};
};
@ -49,7 +54,6 @@ in {
lspconfig.lua_ls.setup {
capabilities = capabilities;
on_attach = default_on_attach;
${optionalString cfg.lsp.neodev.enable "before_init = require('neodev.lsp').before_init;"}
cmd = ${
if isList cfg.lsp.package
then expToLua cfg.lsp.package
@ -59,10 +63,15 @@ in {
'';
})
(mkIf cfg.lsp.neodev.enable {
vim.startPlugins = ["neodev-nvim"];
vim.pluginRC.neodev = entryBefore ["lua-lsp"] ''
require("neodev").setup({})
(mkIf cfg.lsp.lazydev.enable {
vim.startPlugins = ["lazydev-nvim"];
vim.pluginRC.lazydev = entryBefore ["lua-lsp"] ''
require("lazydev").setup({
enabled = function(root_dir)
return not vim.uv.fs_stat(root_dir .. "/.luarc.json")
end,
library = { { path = "''${3rd}/luv/library", words = { "vim%.uv" } } },
})
'';
})
]))

View file

@ -22,7 +22,7 @@ in {
];
vim = {
startPlugins = [
"lsp-signature"
"lsp-signature-nvim"
];
lsp.lspSignature.setupOpts = {

View file

@ -14,7 +14,7 @@ in {
{
vim = {
startPlugins = [
"none-ls"
"none-ls-nvim"
"plenary-nvim"
];

View file

@ -15,7 +15,7 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"todo-comments"
"todo-comments-nvim"
];
maps.normal = mkMerge [

View file

@ -34,7 +34,7 @@ in {
})
(mkIf cfg.enable {
vim = {
startPlugins = ["lualine"];
startPlugins = ["lualine-nvim"];
pluginRC.lualine = entryAnywhere ''
local lualine = require('lualine')
lualine.setup ${toLuaObject cfg.setupOpts}

View file

@ -11,7 +11,7 @@
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["smartcolumn"];
startPlugins = ["smartcolumn-nvim"];
pluginRC.smartcolumn = entryAnywhere ''
require("smartcolumn").setup(${toLuaObject cfg.setupOpts})

View file

@ -14,7 +14,7 @@
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["which-key"];
startPlugins = ["which-key-nvim"];
pluginRC.whichkey = entryAnywhere ''
local wk = require("which-key")

View file

@ -11,7 +11,7 @@
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["highlight-undo"];
startPlugins = ["highlight-undo-nvim"];
pluginRC.highlight-undo = entryAnywhere ''
require("highlight-undo").setup(${toLuaObject cfg.setupOpts})

View file

@ -11,7 +11,7 @@
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["indent-blankline"];
startPlugins = ["indent-blankline-nvim"];
pluginRC.indent-blankline = entryAnywhere ''
require("ibl").setup(${toLuaObject cfg.setupOpts})