diff --git a/pkgs/applications/editors/neovim/tests/default.nix b/pkgs/applications/editors/neovim/tests/default.nix index a5443ab4896c..1c468282d106 100644 --- a/pkgs/applications/editors/neovim/tests/default.nix +++ b/pkgs/applications/editors/neovim/tests/default.nix @@ -55,11 +55,17 @@ let nvim-with-luasnip = wrapNeovim2 "-with-luasnip" (makeNeovimConfig { plugins = [ { plugin = vimPlugins.luasnip; - } ]; }); + # build should fail with a wrong + nvim-run-failing-check = (wrapNeovimUnstable neovim-unwrapped { + luaRcContent = "this is an invalid lua statement to break the build"; + }).overrideAttrs({ + doCheck = true; + }); + nvimAutoDisableWrap = makeNeovimConfig { }; wrapNeovim2 = suffix: config: @@ -96,6 +102,9 @@ in inherit nmt; + # Disabled because of https://github.com/NixOS/nixpkgs/pull/352727 + # failed_check = pkgs.testers.testBuildFailure nvim-run-failing-check; + vim_empty_config = vimUtils.vimrcFile { beforePlugins = ""; customRC = ""; }; ### neovim tests diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 270fdf3ce878..b51e7f08a0bf 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -61,7 +61,7 @@ let stdenv.mkDerivation (finalAttrs: let - pluginsNormalized = neovimUtils.normalizePlugins plugins; + pluginsNormalized = neovimUtils.normalizePlugins finalAttrs.plugins; myVimPackage = neovimUtils.normalizedPluginsToVimPackage pluginsNormalized; @@ -250,6 +250,13 @@ let # A Vim "package", see ':h packages' vimPackage = myVimPackage; + checkPhase = '' + runHook preCheck + + $out/bin/nvim -i NONE -e +quitall! + runHook postCheck + ''; + passthru = { inherit providerLuaRc packpathDirs; unwrapped = neovim-unwrapped;