summary refs log tree commit diff
diff options
context:
space:
mode:
authorErsin Akinci <me@ersinakinci.com>2020-02-21 18:01:37 +0000
committeradisbladis <adisbladis@gmail.com>2020-03-15 12:55:06 +0000
commit588ca6e31077e3b7e691a57a948e77909d2efa18 (patch)
tree107d1a3c4e56bf0a461963db25852e98ee48a2df
parent347479b6e0a25dd8c2b67ebc3516293850d7026f (diff)
downloadnixpkgs-588ca6e31077e3b7e691a57a948e77909d2efa18.tar
nixpkgs-588ca6e31077e3b7e691a57a948e77909d2efa18.tar.gz
nixpkgs-588ca6e31077e3b7e691a57a948e77909d2efa18.tar.bz2
nixpkgs-588ca6e31077e3b7e691a57a948e77909d2efa18.tar.lz
nixpkgs-588ca6e31077e3b7e691a57a948e77909d2efa18.tar.xz
nixpkgs-588ca6e31077e3b7e691a57a948e77909d2efa18.tar.zst
nixpkgs-588ca6e31077e3b7e691a57a948e77909d2efa18.zip
neovim: use TMPDIR as home during initilizaiton
-rw-r--r--pkgs/applications/editors/neovim/wrapper.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix
index c0b97667757..c7d5f764978 100644
--- a/pkgs/applications/editors/neovim/wrapper.nix
+++ b/pkgs/applications/editors/neovim/wrapper.nix
@@ -95,6 +95,16 @@ let
       '' + optionalString (configure != {}) ''
         echo "Generating remote plugin manifest"
         export NVIM_RPLUGIN_MANIFEST=$out/rplugin.vim
+        # Some plugins assume that the home directory is accessible for
+        # initializing caches, temporary files, etc. Even if the plugin isn't
+        # actively used, it may throw an error as soon as Neovim is launched
+        # (e.g., inside an autoload script), causing manifest generation to
+        # fail. Therefore, let's create a fake home directory before generating
+        # the manifest, just to satisfy the needs of these plugins.
+        #
+        # See https://github.com/Yggdroot/LeaderF/blob/v1.21/autoload/lfMru.vim#L10
+        # for an example of this behavior.
+        export HOME="$(mktemp -d)"
         # Launch neovim with a vimrc file containing only the generated plugin
         # code. Pass various flags to disable temp file generation
         # (swap/viminfo) and redirect errors to stderr.