From 2e766b185d2bb6fa38c0bd8fb980ba8fffeedb3a Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 29 Oct 2024 23:05:02 -0400 Subject: use custom wrapper (#70) * use custom wrapper * flake: use nix-filter on self * don't load remote plugins * use nvim-cmp and fidget from luarocks --- neovim.nix | 99 +++++++++++++++++++++++++++++--------------------------------- 1 file changed, 47 insertions(+), 52 deletions(-) (limited to 'neovim.nix') diff --git a/neovim.nix b/neovim.nix index 74dc667..f909fcf 100644 --- a/neovim.nix +++ b/neovim.nix @@ -1,9 +1,10 @@ { - lib, + mkNeovimDerivation, + getchoo-neovim-config, + version, + actionlint, glow, - neovim-unwrapped, - neovimUtils, nil, nixfmt-rfc-style, nodePackages, @@ -12,17 +13,49 @@ statix, typos-lsp, vimPlugins, - wrapNeovimUnstable, - - getchoo-neovim-config, + writeTextDir, }: -let - plugins = with vimPlugins; [ - getchoo-neovim-config +mkNeovimDerivation { + pname = "getchvim"; + inherit version; + + luaRc = writeTextDir "init.lua" "require('getchoo')" + "/init.lua"; + + runtimePrograms = [ + # External programs + glow + + # LSP + ## General + typos-lsp + + ## Language-specific + nodePackages.bash-language-server + shellcheck + shfmt + nil + nixfmt-rfc-style + + # Linters + nodePackages.alex + actionlint + statix + ]; + + luaPluginPackages = + luaPackages: with luaPackages; [ + lz-n - # lazy loader - lz-n + # Coding + nvim-cmp + + # LSP + fidget-nvim + ]; + + vimPluginPackages = with vimPlugins; [ + getchoo-neovim-config # Editing flash-nvim @@ -37,59 +70,21 @@ let lualine-nvim # Coding - nvim-cmp - luasnip cmp-async-path cmp-buffer cmp-nvim-lsp crates-nvim + ## TODO: Use luarocks plugin when it's not broken gitsigns-nvim nvim-lint + ## TODO: Ditto telescope-nvim # dependent on > plenary-nvim # LSP - fidget-nvim lsp-format-nvim nvim-lspconfig trouble-nvim ]; - - extraPackages = [ - # External programs - glow - - # LSP - ## General - typos-lsp - - ## Language-specific - nodePackages.bash-language-server - shellcheck - shfmt - nil - nixfmt-rfc-style - - # Linters - nodePackages.alex - actionlint - statix - ]; - - baseConfig = neovimUtils.makeNeovimConfig { - withRuby = false; - inherit plugins; - }; - - config = baseConfig // { - luaRcContent = "require('getchoo')"; - wrapperArgs = baseConfig.wrapperArgs ++ [ - "--suffix" - "PATH" - ":" - "${lib.makeBinPath extraPackages}" - ]; - }; -in -wrapNeovimUnstable neovim-unwrapped config +} -- cgit v1.2.3