|
|
|
@ -11,8 +11,9 @@ neovim: |
|
|
|
|
|
|
|
|
|
let |
|
|
|
|
wrapper = { |
|
|
|
|
# should contain all args but the binary |
|
|
|
|
wrapperArgs ? "" |
|
|
|
|
extraName ? "" |
|
|
|
|
# should contain all args but the binary. Can be either a string or list |
|
|
|
|
, wrapperArgs ? [] |
|
|
|
|
, manifestRc ? null |
|
|
|
|
, withPython2 ? false |
|
|
|
|
, withPython3 ? true, python3Env ? null |
|
|
|
@ -20,10 +21,18 @@ let |
|
|
|
|
, rubyEnv ? null |
|
|
|
|
, vimAlias ? false |
|
|
|
|
, viAlias ? false |
|
|
|
|
|
|
|
|
|
# additional argument not generated by makeNeovimConfig |
|
|
|
|
# it will append "-u <customRc>" to the wrapped arguments |
|
|
|
|
# set to false if you want to control where to save the generated config |
|
|
|
|
# (e.g., in ~/.config/init.vim or project/.nvimrc) |
|
|
|
|
, wrapRc ? true |
|
|
|
|
, ... |
|
|
|
|
}: |
|
|
|
|
}@args: |
|
|
|
|
let |
|
|
|
|
|
|
|
|
|
wrapperArgsStr = if isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs; |
|
|
|
|
|
|
|
|
|
# If configure != {}, we can't generate the rplugin.vim file with e.g |
|
|
|
|
# NVIM_SYSTEM_RPLUGIN_MANIFEST *and* NVIM_RPLUGIN_MANIFEST env vars set in |
|
|
|
|
# the wrapper. That's why only when configure != {} (tested both here and |
|
|
|
@ -31,13 +40,15 @@ 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" ] ++ |
|
|
|
|
[ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ]; |
|
|
|
|
[ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ] |
|
|
|
|
++ [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ] |
|
|
|
|
++ optionals wrapRc [ "--add-flags" "-u ${writeText "init.vim" args.neovimRcContent}" ] |
|
|
|
|
; |
|
|
|
|
in |
|
|
|
|
assert withPython2 -> throw "Python2 support has been removed from the neovim wrapper, please remove withPython2 and python2Env."; |
|
|
|
|
|
|
|
|
|
symlinkJoin { |
|
|
|
|
name = "neovim-${lib.getVersion neovim}"; |
|
|
|
|
name = "neovim-${lib.getVersion neovim}${extraName}"; |
|
|
|
|
# Remove the symlinks created by symlinkJoin which we need to perform |
|
|
|
|
# extra actions upon |
|
|
|
|
postBuild = lib.optionalString stdenv.isLinux '' |
|
|
|
@ -66,7 +77,7 @@ let |
|
|
|
|
in '' |
|
|
|
|
echo "Generating remote plugin manifest" |
|
|
|
|
export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim |
|
|
|
|
makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} ${wrapperArgs} |
|
|
|
|
makeWrapper ${lib.escapeShellArgs manifestWrapperArgs} ${wrapperArgsStr} |
|
|
|
|
|
|
|
|
|
# Some plugins assume that the home directory is accessible for |
|
|
|
|
# initializing caches, temporary files, etc. Even if the plugin isn't |
|
|
|
@ -96,7 +107,7 @@ let |
|
|
|
|
'') |
|
|
|
|
+ '' |
|
|
|
|
rm $out/bin/nvim |
|
|
|
|
makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgs} |
|
|
|
|
makeWrapper ${lib.escapeShellArgs finalMakeWrapperArgs} ${wrapperArgsStr} |
|
|
|
|
''; |
|
|
|
|
|
|
|
|
|
paths = [ neovim ]; |
|
|
|
|