diff --git a/flake.lock b/flake.lock index 30248134..1e60b8fa 100644 Binary files a/flake.lock and b/flake.lock differ diff --git a/flake.nix b/flake.nix index 58a27048..db600794 100644 Binary files a/flake.nix and b/flake.nix differ diff --git a/homeManagerModules/neovim/langs/c-lang/default.nix b/homeManagerModules/neovim/langs/c-lang/default.nix index 97fb5630..ae519d0c 100644 --- a/homeManagerModules/neovim/langs/c-lang/default.nix +++ b/homeManagerModules/neovim/langs/c-lang/default.nix @@ -29,8 +29,9 @@ in { if (devShells['c-lang'] == nil) then devShells['c-lang'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#c-lang'}); - vim.cmd[[LspStart]]; + require('nix-develop').nix_develop({'${flakeEnv}#c-lang'}, vim.schedule_wrap(function() + vim.cmd[[LspStart]]; + end)); end end, }); diff --git a/homeManagerModules/neovim/langs/csharp/default.nix b/homeManagerModules/neovim/langs/csharp/default.nix index aeb34360..0907a0fb 100644 --- a/homeManagerModules/neovim/langs/csharp/default.nix +++ b/homeManagerModules/neovim/langs/csharp/default.nix @@ -70,11 +70,10 @@ in { if (devShells['csharp'] == nil) then devShells['csharp'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#csharp'}); - startRoslyn(); - - os.execute('sleep 1') - vim.cmd[[e]]; -- reload to attach on current file + require('nix-develop').nix_develop({'${flakeEnv}#csharp'}, vim.schedule_wrap(function() + startRoslyn(); + vim.cmd[[e]]; -- reload to attach on current file + end)); end end, }); diff --git a/homeManagerModules/neovim/langs/default.nix b/homeManagerModules/neovim/langs/default.nix index 4df45eb8..c285c9e7 100644 --- a/homeManagerModules/neovim/langs/default.nix +++ b/homeManagerModules/neovim/langs/default.nix @@ -4,6 +4,9 @@ self: { pkgs, ... }: let + inherit (self.inputs) nix-develop-nvim-src; + inherit (self.lib.${pkgs.system}) mkVersion; + inherit (lib) fileContents mkBefore mkIf; cfg = config.programs.neovim; @@ -63,7 +66,6 @@ in { # lsp plugins nvim-lspconfig lsp-status-nvim - nix-develop-nvim # completion plugins cmp-buffer cmp-nvim-lsp @@ -73,6 +75,12 @@ in { ; }) ++ [ + # FIXME: defer inside plugin instead + (pkgs.vimPlugins.nix-develop-nvim.overrideAttrs (o: { + name = "vimplugin-${o.pname}-${mkVersion nix-develop-nvim-src}"; + src = nix-develop-nvim-src; + })) + { plugin = pkgs.vimPlugins.nvim-cmp; type = "lua"; diff --git a/homeManagerModules/neovim/langs/json/default.nix b/homeManagerModules/neovim/langs/json/default.nix index 3d4c3409..8fad537b 100644 --- a/homeManagerModules/neovim/langs/json/default.nix +++ b/homeManagerModules/neovim/langs/json/default.nix @@ -23,8 +23,9 @@ in { if (devShells['json'] == nil) then devShells['json'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#json'}); - vim.cmd[[LspStart]]; + require('nix-develop').nix_develop({'${flakeEnv}#json'}, vim.schedule_wrap(function() + vim.cmd[[LspStart]]; + end)); end end, }); diff --git a/homeManagerModules/neovim/langs/lua/default.nix b/homeManagerModules/neovim/langs/lua/default.nix index c8ea2368..1dc722c1 100644 --- a/homeManagerModules/neovim/langs/lua/default.nix +++ b/homeManagerModules/neovim/langs/lua/default.nix @@ -31,8 +31,9 @@ in { if (devShells['lua'] == nil) then devShells['lua'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#lua'}); - vim.cmd[[LspStart]]; + require('nix-develop').nix_develop({'${flakeEnv}#lua'}, vim.schedule_wrap(function() + vim.cmd[[LspStart]]; + end)); end end, }); diff --git a/homeManagerModules/neovim/langs/markdown/default.nix b/homeManagerModules/neovim/langs/markdown/default.nix index 3bde213c..a80b1390 100644 --- a/homeManagerModules/neovim/langs/markdown/default.nix +++ b/homeManagerModules/neovim/langs/markdown/default.nix @@ -35,8 +35,9 @@ in { if (devShells['markdown'] == nil) then devShells['markdown'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#markdown'}); - vim.cmd[[LspStart]]; + require('nix-develop').nix_develop({'${flakeEnv}#markdown'}, vim.schedule_wrap(function() + vim.cmd[[LspStart]]; + end)); end end, }); diff --git a/homeManagerModules/neovim/langs/rust/default.nix b/homeManagerModules/neovim/langs/rust/default.nix index b58b6648..917c2ea8 100644 --- a/homeManagerModules/neovim/langs/rust/default.nix +++ b/homeManagerModules/neovim/langs/rust/default.nix @@ -23,8 +23,9 @@ in { if (devShells['rust'] == nil) then devShells['rust'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#rust'}); - vim.cmd[[LspStart]]; + require('nix-develop').nix_develop({'${flakeEnv}#rust'}, vim.schedule_wrap(function() + vim.cmd[[LspStart]]; + end)); end end, }); diff --git a/homeManagerModules/neovim/langs/web/default.nix b/homeManagerModules/neovim/langs/web/default.nix index f9840d95..df9aa769 100644 --- a/homeManagerModules/neovim/langs/web/default.nix +++ b/homeManagerModules/neovim/langs/web/default.nix @@ -29,8 +29,9 @@ in { if (devShells['web'] == nil) then devShells['web'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#web'}); - vim.cmd[[LspStart]]; + require('nix-develop').nix_develop({'${flakeEnv}#web'}, vim.schedule_wrap(function() + vim.cmd[[LspStart]]; + end)); end end, }); @@ -44,8 +45,9 @@ in { if (devShells['web'] == nil) then devShells['web'] = 1; - require('nix-develop').nix_develop({'${flakeEnv}#web'}); - vim.cmd[[LspStart]]; + require('nix-develop').nix_develop({'${flakeEnv}#web'}, vim.schedule_wrap(function() + vim.cmd[[LspStart]]; + end)); end end, }); diff --git a/inputs/default.nix b/inputs/default.nix index 34473ff6..6d3438c6 100644 --- a/inputs/default.nix +++ b/inputs/default.nix @@ -281,6 +281,11 @@ let owner = "seblj"; repo = "roslyn.nvim"; } + { + name = "nix-develop-nvim-src"; + owner = "matt1432"; + repo = "nix-develop.nvim"; + } # Overlays & packages {