From 95702fe6d2ed934146b0cc8b81efd9fac5ac6e29 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 31 Oct 2020 14:24:52 +0100 Subject: [PATCH 1/2] neovim: revert change to extraMakeWrapperArgs wrapNeovim incited users to use a list instead of a string. Revert that: the change is not super useful while breaking home-manager. --- pkgs/applications/editors/neovim/utils.nix | 12 ++++-------- pkgs/applications/editors/neovim/wrapper.nix | 10 +++++----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/editors/neovim/utils.nix b/pkgs/applications/editors/neovim/utils.nix index 1c49f6e0fbe..15d3f214057 100644 --- a/pkgs/applications/editors/neovim/utils.nix +++ b/pkgs/applications/editors/neovim/utils.nix @@ -118,7 +118,7 @@ let # to keep backwards compatibility legacyWrapper = neovim: { - extraMakeWrapperArgs ? [] + extraMakeWrapperArgs ? "" , withPython ? true /* the function you would have passed to python.withPackages */ , extraPythonPackages ? (_: []) @@ -147,13 +147,9 @@ let }; in wrapNeovimUnstable neovim (res // { - wrapperArgs = res.wrapperArgs - ++ [ - "--add-flags" "-u ${writeText "init.vim" res.neovimRcContent}" - ] - ++ (if builtins.isList extraMakeWrapperArgs then extraMakeWrapperArgs - else lib.warn "Passing a string as extraMakeWrapperArgs to the neovim wrapper is - deprecated, please use a list instead") + wrapperArgs = lib.escapeShellArgs ( + res.wrapperArgs ++ [ "--add-flags" "-u ${writeText "init.vim" res.neovimRcContent}" ]) + + " " + extraMakeWrapperArgs ; }); in diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 06ef920e276..d18d13a050f 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -14,7 +14,7 @@ neovim: let wrapper = { # should contain all args but the binary - wrapperArgs ? [] + wrapperArgs ? "" , manifestRc ? null , withPython2 ? true, python2Env ? null , withPython3 ? true, python3Env ? null @@ -33,7 +33,7 @@ let # wrapper with most arguments we need, excluding those that cause problems to # generate rplugin.vim, but still required for the final wrapper. finalMakeWrapperArgs = - [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ] ++ wrapperArgs ++ + [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ] ++ [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ]; in symlinkJoin { @@ -66,11 +66,11 @@ let '' + optionalString (manifestRc != null) (let manifestWrapperArgs = - [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" ] ++ wrapperArgs; + [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" ]; in '' echo "Generating remote plugin manifest" export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim - makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} + makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} ${wrapperArgs} # Some plugins assume that the home directory is accessible for # initializing caches, temporary files, etc. Even if the plugin isn't @@ -100,7 +100,7 @@ let '') + '' rm $out/bin/nvim - makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} + makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgs} ''; paths = [ neovim ]; From db157224ef26d088b66d30b62a50f602ef526545 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Sat, 31 Oct 2020 15:52:24 +0100 Subject: [PATCH 2/2] neovim: restore neovim.override the compatibility layer for `wrapNeovim` introduced in https://github.com/NixOS/nixpkgs/pull/101265 broke the recommended way of configuration: https://nixos.org/manual/nixpkgs/stable/#custom-configuration https://nixos.wiki/wiki/Vim#Customizations restore the old ways. --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 82bf8bc78ca..7cf33ee0a74 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23984,7 +23984,7 @@ in # more usecases when wrapping neovim. The interface is being actively worked on # so expect breakage. use wrapNeovim instead if you want a stable alternative wrapNeovimUnstable = callPackage ../applications/editors/neovim/wrapper.nix { }; - wrapNeovim = neovimUtils.legacyWrapper; + wrapNeovim = neovim-unwrapped: lib.makeOverridable (neovimUtils.legacyWrapper neovim-unwrapped); neovim-unwrapped = callPackage ../applications/editors/neovim { lua = # neovim doesn't work with luajit on aarch64: https://github.com/neovim/neovim/issues/7879