diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index e3c03c92e58..cdc9a441dc5 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -1,5 +1,6 @@ { stdenv, symlinkJoin, lib, makeWrapper , vimUtils +, writeText , bundlerEnv, ruby , nodejs , nodePackages @@ -110,9 +111,9 @@ let # https://github.com/neovim/neovim/issues/9413 ++ lib.optionals (configure != {}) [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" - "--add-flags" "-u ${vimUtils.vimrcFile configure}" - ] - ; + "--add-flags" "-u ${configFile}" + ]; + configFile = writeText "init.vim" "${vimUtils.vimrcContent configure}"; in symlinkJoin { name = "neovim-${stdenv.lib.getVersion neovim}"; @@ -181,7 +182,7 @@ let preferLocalBuild = true; buildInputs = [makeWrapper]; - passthru = { unwrapped = neovim; }; + passthru = { unwrapped = neovim; inherit configFile; }; meta = neovim.meta // { # To prevent builds on hydra diff --git a/pkgs/misc/vim-plugins/vim-utils.nix b/pkgs/misc/vim-plugins/vim-utils.nix index 5e1703c8cc3..ee77599a3ba 100644 --- a/pkgs/misc/vim-plugins/vim-utils.nix +++ b/pkgs/misc/vim-plugins/vim-utils.nix @@ -183,7 +183,7 @@ let rtpPath = "share/vim-plugins"; - vimrcFile = { + vimrcContent = { packages ? null, vam ? null, pathogen ? null, @@ -338,7 +338,7 @@ let filetype indent plugin on | syn on ''); - in writeText "vimrc" '' + in '' " configuration generated by NIX set nocompatible @@ -351,11 +351,13 @@ let ${customRC} ''; + vimrcFile = settings: writeText "vimrc" (vimrcContent settings); in rec { inherit vimrcFile; + inherit vimrcContent; # shell script with custom name passing [-u vimrc] [-U gvimrc] to vim vimWithRC = {