neovim: uses vimUtils to make it configurable like vim_configurable is
- vimAlias argument , when true, will create a @out/bin/vim symlink - configure argument, which will configure neovim the same way as it does vim_configurable. eg.: ~/.nixpkgs/config.nix { packageOverrides = pkgs : with pkgs; rec { vimg = neovim.override { vimAlias = true; configure = { customRC = '' set spell ''; vam.pluginDictionaries = [ { names = [ "youcompleteme" "ctrlp"]; } ]; }; }; }; } Enjoy!
This commit is contained in:
parent
6125f583e6
commit
19248c309a
@ -1,9 +1,13 @@
|
||||
{ stdenv, fetchFromGitHub, cmake, gettext, glib, libmsgpack
|
||||
, libtermkey, libtool, libuv, lpeg, lua, luajit, luaMessagePack
|
||||
, luabitop, ncurses, perl, pkgconfig, unibilium, makeWrapper
|
||||
{ stdenv, fetchFromGitHub, cmake, gettext, glib, libmsgpack, libtermkey
|
||||
, libtool, libuv, lpeg, lua, luajit, luaMessagePack, luabitop, ncurses, perl
|
||||
, pkgconfig, unibilium, makeWrapper, vimUtils
|
||||
|
||||
, withPython ? true, pythonPackages, extraPythonPackages ? []
|
||||
, withPython3 ? true, python3Packages, extraPython3Packages ? []
|
||||
, withJemalloc ? true, jemalloc
|
||||
|
||||
, vimAlias ? false
|
||||
, configure ? null
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
@ -48,7 +52,7 @@ let
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
neovim = stdenv.mkDerivation rec {
|
||||
name = "neovim-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
@ -94,7 +98,7 @@ in stdenv.mkDerivation rec {
|
||||
(optionalString withPython
|
||||
''--cmd \"let g:python_host_prog='$out/bin/nvim-python'\" '') +
|
||||
(optionalString withPython3
|
||||
''--cmd \"let g:python3_host_prog='$out/bin/nvim-python3'\"'')
|
||||
''--cmd \"let g:python3_host_prog='$out/bin/nvim-python3'\" '')
|
||||
}"
|
||||
'';
|
||||
|
||||
@ -115,7 +119,22 @@ in stdenv.mkDerivation rec {
|
||||
# those contributions were copied from Vim (identified in the commit logs
|
||||
# by the vim-patch token). See LICENSE for details."
|
||||
license = with licenses; [ asl20 vim ];
|
||||
maintainers = with maintainers; [ manveru nckx ];
|
||||
maintainers = with maintainers; [ manveru nckx garbas ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
};
|
||||
|
||||
in if (vimAlias == false && configure == null) then neovim else stdenv.mkDerivation rec {
|
||||
name = "neovim-${version}-configured";
|
||||
buildInputs = [ makeWrapper ];
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
for item in ${neovim}/bin/*; do
|
||||
ln -s $item $out/bin/
|
||||
done
|
||||
'' + optionalString vimAlias ''
|
||||
ln -s $out/bin/nvim $out/bin/vim
|
||||
'' + optionalString (configure != null) ''
|
||||
wrapProgram $out/bin/nvim --add-flags "-u ${vimUtils.vimrcFile configure}"
|
||||
'';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user