|
@@ -94,20 +94,62 @@ let
|
|
|
++ [
|
|
|
extra-treesitter-textobjects
|
|
|
];
|
|
|
-in
|
|
|
-stdenv.mkDerivation {
|
|
|
- pname = "nvim";
|
|
|
- version = neovim-unwrapped.version;
|
|
|
|
|
|
- initVim = ''
|
|
|
- let g:loaded_python3_provider = 0
|
|
|
- let g:loaded_ruby_provider = 0
|
|
|
- let g:loaded_node_provider = 0
|
|
|
- let g:loaded_perl_provider = 0
|
|
|
+ generic = { initText ? "", enabledPlugins ? [], passthru ? {} }: stdenv.mkDerivation {
|
|
|
+ pname = "nvim";
|
|
|
+ version = neovim-unwrapped.version;
|
|
|
+
|
|
|
+ initVim = ''
|
|
|
+ let g:loaded_python3_provider = 0
|
|
|
+ let g:loaded_ruby_provider = 0
|
|
|
+ let g:loaded_node_provider = 0
|
|
|
+ let g:loaded_perl_provider = 0
|
|
|
+
|
|
|
+ set runtimepath^=${placeholder "out"}/lib
|
|
|
+ set packpath^=${placeholder "out"}/lib
|
|
|
+
|
|
|
+ ${initText}
|
|
|
+ '';
|
|
|
+
|
|
|
+ passAsFile = [ "initVim" ];
|
|
|
+
|
|
|
+ nativeBuildInputs = [ makeWrapper ];
|
|
|
+
|
|
|
+ unpackPhase = ":";
|
|
|
+
|
|
|
+ buildPhase = ''
|
|
|
+ # build pack / runtime dir
|
|
|
+ mkdir -p lib/pack/nixpkgs/start
|
|
|
+ ${lib.concatMapStringsSep "\n" (p: ''
|
|
|
+ ln -s "${p}" "lib/pack/nixpkgs/start/${lib.getName p}"
|
|
|
+ '') enabledPlugins}
|
|
|
+
|
|
|
+ # create config file
|
|
|
+ mkdir etc
|
|
|
+ cp "$initVimPath" etc/init.vim
|
|
|
+
|
|
|
+ # symlink in man pages
|
|
|
+ mkdir -p share
|
|
|
+ ln -s ${neovim-unwrapped}/share/man share/man
|
|
|
+
|
|
|
+ # make bin
|
|
|
+ mkdir bin
|
|
|
+ makeWrapper ${neovim-unwrapped}/bin/nvim bin/nvim \
|
|
|
+ --prefix PATH : ${lib.makeBinPath extraPath} \
|
|
|
+ --add-flags -u \
|
|
|
+ --add-flags $out/etc/init.vim
|
|
|
+ '';
|
|
|
|
|
|
- set runtimepath^=${placeholder "out"}/lib
|
|
|
- set packpath^=${placeholder "out"}/lib
|
|
|
+ inherit passthru;
|
|
|
|
|
|
+ installPhase = ''
|
|
|
+ mkdir $out
|
|
|
+ cp -r * $out
|
|
|
+ '';
|
|
|
+ };
|
|
|
+in
|
|
|
+generic {
|
|
|
+ initText = ''
|
|
|
source ${./settings.lua}
|
|
|
source ${./plugins.lua}
|
|
|
source ${./mappings.lua}
|
|
@@ -121,37 +163,9 @@ stdenv.mkDerivation {
|
|
|
source ${./luadev.lua}
|
|
|
'';
|
|
|
|
|
|
- passAsFile = [ "initVim" ];
|
|
|
-
|
|
|
- nativeBuildInputs = [ makeWrapper ];
|
|
|
-
|
|
|
- unpackPhase = ":";
|
|
|
-
|
|
|
- buildPhase = ''
|
|
|
- # build pack / runtime dir
|
|
|
- mkdir -p lib/pack/nixpkgs/start
|
|
|
- ${lib.concatMapStringsSep "\n" (p: ''
|
|
|
- ln -s "${p}" "lib/pack/nixpkgs/start/${lib.getName p}"
|
|
|
- '') plugins}
|
|
|
+ enabledPlugins = plugins;
|
|
|
|
|
|
- # create config file
|
|
|
- mkdir etc
|
|
|
- cp "$initVimPath" etc/init.vim
|
|
|
-
|
|
|
- # symlink in man pages
|
|
|
- mkdir -p share
|
|
|
- ln -s ${neovim-unwrapped}/share/man share/man
|
|
|
-
|
|
|
- # make bin
|
|
|
- mkdir bin
|
|
|
- makeWrapper ${neovim-unwrapped}/bin/nvim bin/nvim \
|
|
|
- --prefix PATH : ${lib.makeBinPath extraPath} \
|
|
|
- --add-flags -u \
|
|
|
- --add-flags $out/etc/init.vim
|
|
|
- '';
|
|
|
-
|
|
|
- installPhase = ''
|
|
|
- mkdir $out
|
|
|
- cp -r * $out
|
|
|
- '';
|
|
|
+ passthru = {
|
|
|
+ minimal = generic {};
|
|
|
+ };
|
|
|
}
|