neovimUtils.packDir: init: extend vimUtils.packDir
in order for neovim to catch plugins dependencies, we fork vimUtils.packDir as `neovimUtils.packDir` to merge the various plugins nix-support/propagated-build-inputs files in the packDir derivation $out/nix-support/propagated-build-inputs where there was previously none. Having a fork allows us to experiment without impacting vim plugins. Once we are more confident this doesn't break stuff and/or the implementation is final, we can merge the fork back or replace one by the other.
This commit is contained in:
@@ -229,12 +229,36 @@ let
|
||||
ln -s ${grammar}/parser $out/parser/${name}.so
|
||||
'');
|
||||
|
||||
/*
|
||||
Fork of vimUtils.packDir that additionnally generates a propagated-build-inputs-file that
|
||||
can be used by the lua hooks to generate a proper LUA_PATH
|
||||
|
||||
Generates a packpath folder as expected by vim
|
||||
Example:
|
||||
packDir ( {myVimPackage = { start = [ vimPlugins.vim-fugitive ]; opt = []; }; })
|
||||
=> "/nix/store/xxxxx-pack-dir"
|
||||
*/
|
||||
packDir = packages:
|
||||
let
|
||||
rawPackDir = vimUtils.packDir packages;
|
||||
|
||||
in
|
||||
rawPackDir.override ({
|
||||
postBuild = ''
|
||||
mkdir $out/nix-support
|
||||
for i in $(find -L $out -name propagated-build-inputs ); do
|
||||
cat "$i" >> $out/nix-support/propagated-build-inputs
|
||||
done
|
||||
'';});
|
||||
|
||||
|
||||
in
|
||||
{
|
||||
inherit makeNeovimConfig;
|
||||
inherit generateProviderRc;
|
||||
inherit legacyWrapper;
|
||||
inherit grammarToPlugin;
|
||||
inherit packDir;
|
||||
|
||||
inherit buildNeovimPlugin;
|
||||
buildNeovimPluginFrom2Nix = lib.warn "buildNeovimPluginFrom2Nix was renamed to buildNeovimPlugin" buildNeovimPlugin;
|
||||
|
||||
@@ -24,6 +24,8 @@ let
|
||||
, withNodeJs ? false
|
||||
, withPerl ? false
|
||||
, rubyEnv ? null
|
||||
|
||||
# wether to create symlinks in $out/bin/vi(m) -> $out/bin/nvim
|
||||
, vimAlias ? false
|
||||
, viAlias ? false
|
||||
|
||||
@@ -45,6 +47,8 @@ let
|
||||
stdenv.mkDerivation (finalAttrs:
|
||||
let
|
||||
|
||||
finalPackdir = neovimUtils.packDir packpathDirs;
|
||||
|
||||
rcContent = ''
|
||||
${luaRcContent}
|
||||
'' + lib.optionalString (!isNull neovimRcContent) ''
|
||||
@@ -58,9 +62,10 @@ let
|
||||
[
|
||||
"--add-flags" ''--cmd "lua ${providerLuaRc}"''
|
||||
# (lib.intersperse "|" hostProviderViml)
|
||||
] ++ lib.optionals (packpathDirs.myNeovimPackages.start != [] || packpathDirs.myNeovimPackages.opt != []) [
|
||||
"--add-flags" ''--cmd "set packpath^=${vimUtils.packDir packpathDirs}"''
|
||||
"--add-flags" ''--cmd "set rtp^=${vimUtils.packDir packpathDirs}"''
|
||||
]
|
||||
++ lib.optionals (packpathDirs.myNeovimPackages.start != [] || packpathDirs.myNeovimPackages.opt != []) [
|
||||
"--add-flags" ''--cmd "set packpath^=${finalPackdir}"''
|
||||
"--add-flags" ''--cmd "set rtp^=${finalPackdir}"''
|
||||
]
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user