Merge master into staging-next

This commit is contained in:
Frederik Rietdijk
2018-12-31 12:00:36 +01:00
172 changed files with 2734 additions and 2541 deletions

View File

@@ -20,13 +20,13 @@ let
};
in stdenv.mkDerivation rec {
name = "dolphin-emu-${version}";
version = "2018-09-24";
version = "2018-12-25";
src = fetchFromGitHub {
owner = "dolphin-emu";
repo = "dolphin";
rev = "97b1a9bb2a0c29f0f68963483156d5285e1fb1d5";
sha256 = "0dwc4l7a7r1f65gh1rhxa854xsknrgp62rr3a0y67lk3xf5y38d7";
rev = "ca2a2c98f252d21dc609d26f4264a43ed091b8fe";
sha256 = "0903hp7fkh08ggjx8zrsvwhh1x8bprv3lh2d8yci09al1cqqj5cb";
};
enableParallelBuilding = true;

View File

@@ -11,7 +11,10 @@ python3Packages.buildPythonApplication rec {
sha256 = "1yn18pwsjxpxz5j3yfysmaif8k0vqahj5c7ays9cxsylpg9hl7jd";
};
propagatedBuildInputs = with python3Packages; [ lilypond pygame python-ly poppler-qt5 ];
propagatedBuildInputs = with python3Packages; [
lilypond pygame python-ly sip
pyqt5_with_qtwebkit (poppler-qt5.override { pyqt5 = pyqt5_with_qtwebkit; })
];
# no tests in shipped with upstream
doCheck = false;

View File

@@ -0,0 +1,60 @@
{ stdenv
, rtpPath ? "share/vim-plugins"
, vim
}:
rec {
addRtp = path: attrs: derivation:
derivation // { rtp = "${derivation}/${path}"; } // {
overrideAttrs = f: buildVimPlugin (attrs // f attrs);
};
buildVimPlugin = attrs@{
name ? "${attrs.pname}-${attrs.version}",
namePrefix ? "vimplugin-",
src,
unpackPhase ? "",
configurePhase ? "",
buildPhase ? "",
preInstall ? "",
postInstall ? "",
path ? (builtins.parseDrvName name).name,
addonInfo ? null,
...
}:
addRtp "${rtpPath}/${path}" attrs (stdenv.mkDerivation (attrs // {
name = namePrefix + name;
inherit unpackPhase configurePhase buildPhase addonInfo preInstall postInstall;
installPhase = ''
runHook preInstall
target=$out/${rtpPath}/${path}
mkdir -p $out/${rtpPath}
cp -r . $target
# build help tags
if [ -d "$target/doc" ]; then
echo "Building help tags"
if ! ${vim}/bin/vim -N -u NONE -i NONE -n -E -s -c "helptags $target/doc" +quit!; then
echo "Failed to build help tags!"
exit 1
fi
else
echo "No docs available"
fi
if [ -n "$addonInfo" ]; then
echo "$addonInfo" > $target/addon-info.json
fi
runHook postInstall
'';
}));
buildVimPluginFrom2Nix = attrs: buildVimPlugin ({
buildPhase = ":";
configurePhase =":";
} // attrs);
}

View File

@@ -5,8 +5,8 @@ let
inherit (vimUtils.override {inherit vim;}) buildVimPluginFrom2Nix;
generated = callPackage ./generated.nix {
inherit buildVimPluginFrom2Nix;
plugins = callPackage ./generated.nix {
inherit buildVimPluginFrom2Nix overrides;
};
# TL;DR
@@ -22,10 +22,8 @@ let
inherit llvmPackages;
};
overriden = generated // (overrides generated);
aliases = lib.optionalAttrs (config.allowAliases or true) (import ./aliases.nix lib overriden);
aliases = lib.optionalAttrs (config.allowAliases or true) (import ./aliases.nix lib plugins);
in
overriden // aliases
plugins // aliases

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,9 @@
{config, lib, stdenv
, python, cmake, vim, vimUtils, ruby
{ lib, stdenv
, python, cmake, vim, ruby
, which, fetchgit, llvmPackages, rustPlatform
, xkb_switch, fzf, skim
, python3, boost, icu, ncurses
, ycmd, rake
, pythonPackages, python3Packages
, substituteAll
, languagetool
, Cocoa, CoreFoundation, CoreServices
@@ -17,34 +16,22 @@
, impl, iferr, gocode, gocode-gomod, go-tools
}:
let
_skim = skim;
in
generated:
with generated;
{
self: super: {
vim2nix = buildVimPluginFrom2Nix {
name = "vim2nix";
src = ./vim2nix;
dependencies = ["vim-addon-manager"];
dependencies = with super; [ vim-addon-manager ];
};
fzfWrapper = buildVimPluginFrom2Nix {
name = fzf.name;
src = fzf.src;
dependencies = [];
};
skim = buildVimPluginFrom2Nix {
name = _skim.name;
src = _skim.vim;
dependencies = [];
name = skim.name;
src = skim.vim;
};
LanguageClient-neovim = let
@@ -70,7 +57,6 @@ with generated;
name = "LanguageClient-neovim-2018-09-07";
src = LanguageClient-neovim-src;
dependencies = [];
propogatedBuildInputs = [ LanguageClient-neovim-bin ];
preFixup = ''
@@ -87,10 +73,9 @@ with generated;
rev = "69cce66defdf131958f152ea7a7b26c21ca9d009";
sha256 = "1363b2fmv69axrl2hm74dmx51cqd8k7rk116890qllnapzw1zjgc";
};
dependencies = [];
};
clang_complete = clang_complete.overrideAttrs(old: {
clang_complete = super.clang_complete.overrideAttrs(old: {
# In addition to the arguments you pass to your compiler, you also need to
# specify the path of the C++ std header (if you are using C++).
# These usually implicitly set by cc-wrapper around clang (pkgs/build-support/cc-wrapper).
@@ -107,14 +92,14 @@ with generated;
'';
});
clighter8 = clighter8.overrideAttrs(old: {
clighter8 = super.clighter8.overrideAttrs(old: {
preFixup = ''
sed "/^let g:clighter8_libclang_path/s|')$|${llvmPackages.clang.cc.lib}/lib/libclang.so')|" \
-i "$out"/share/vim-plugins/clighter8/plugin/clighter8.vim
'';
});
command-t = command-t.overrideAttrs(old: {
command-t = super.command-t.overrideAttrs(old: {
buildInputs = [ ruby rake ];
buildPhase = ''
rake make
@@ -122,7 +107,7 @@ with generated;
'';
});
cpsm = cpsm.overrideAttrs(old: {
cpsm = super.cpsm.overrideAttrs(old: {
buildInputs = [
python3
stdenv
@@ -138,7 +123,7 @@ with generated;
'';
});
ctrlp-cmatcher = ctrlp-cmatcher.overrideAttrs(old: {
ctrlp-cmatcher = super.ctrlp-cmatcher.overrideAttrs(old: {
buildInputs = [ python ];
buildPhase = ''
patchShebangs .
@@ -146,7 +131,7 @@ with generated;
'';
});
deoplete-go = deoplete-go.overrideAttrs(old: {
deoplete-go = super.deoplete-go.overrideAttrs(old: {
buildInputs = [ python3 ];
buildPhase = ''
pushd ./rplugin/python3/deoplete/ujson
@@ -156,114 +141,106 @@ with generated;
'';
});
ensime-vim = ensime-vim.overrideAttrs(old: {
ensime-vim = super.ensime-vim.overrideAttrs(old: {
passthru.python3Dependencies = ps: with ps; [ sexpdata websocket_client ];
dependencies = ["vimproc" "vimshell" "self" "forms"];
dependencies = with super; [ vimproc-vim vimshell-vim super.self forms ];
});
forms = forms.overrideAttrs(old: {
dependencies = ["self"];
forms = super.forms.overrideAttrs(old: {
dependencies = with super; [ super.self ];
});
gist-vim = gist-vim.overrideAttrs(old: {
dependencies = ["webapi-vim"];
gist-vim = super.gist-vim.overrideAttrs(old: {
dependencies = with super; [ webapi-vim ];
});
gitv = gitv.overrideAttrs(old: {
dependencies = ["gitv"];
ncm2 = super.ncm2.overrideAttrs(old: {
dependencies = with super; [ nvim-yarp ];
});
ncm2 = ncm2.overrideAttrs(old: {
dependencies = ["nvim-yarp"];
ncm2-jedi = super.ncm2-jedi.overrideAttrs(old: {
dependencies = with super; [ nvim-yarp ncm2 ];
passthru.python3Dependencies = ps: with ps; [ jedi ];
});
ncm2-ultisnips = ncm2-ultisnips.overrideAttrs(old: {
dependencies = ["ultisnips"];
ncm2-ultisnips = super.ncm2-ultisnips.overrideAttrs(old: {
dependencies = with super; [ ultisnips ];
});
taglist-vim = taglist-vim.overrideAttrs(old: {
setSourceRoot = ''
export sourceRoot=taglist
mkdir taglist
mv doc taglist
mv plugin taglist
'';
vimshell-vim = super.vimshell-vim.overrideAttrs(old: {
dependencies = with super; [ vimproc-vim ];
});
vimshell-vim = vimshell-vim.overrideAttrs(old: {
dependencies = [ "vimproc-vim" ];
});
vim-addon-manager = vim-addon-manager.overrideAttrs(old: {
vim-addon-manager = super.vim-addon-manager.overrideAttrs(old: {
buildInputs = stdenv.lib.optional stdenv.isDarwin Cocoa;
});
vim-addon-actions = vim-addon-actions.overrideAttrs(old: {
dependencies = [ "vim-addon-mw-utils" "tlib" ];
vim-addon-actions = super.vim-addon-actions.overrideAttrs(old: {
dependencies = with super; [ vim-addon-mw-utils tlib_vim ];
});
vim-addon-async = vim-addon-async.overrideAttrs(old: {
dependencies = [ "vim-addon-signs" ];
vim-addon-async = super.vim-addon-async.overrideAttrs(old: {
dependencies = with super; [ vim-addon-signs ];
});
vim-addon-background-cmd = vim-addon-background-cmd.overrideAttrs(old: {
dependencies = [ "vim-addon-mw-utils" ];
vim-addon-background-cmd = super.vim-addon-background-cmd.overrideAttrs(old: {
dependencies = with super; [ vim-addon-mw-utils ];
});
vim-addon-completion = vim-addon-completion.overrideAttrs(old: {
dependencies = [ "tlib" ];
vim-addon-completion = super.vim-addon-completion.overrideAttrs(old: {
dependencies = with super; [ tlib_vim ];
});
vim-addon-goto-thing-at-cursor = vim-addon-goto-thing-at-cursor.overrideAttrs(old: {
dependencies = [ "tlib" ];
vim-addon-goto-thing-at-cursor = super.vim-addon-goto-thing-at-cursor.overrideAttrs(old: {
dependencies = with super; [ tlib_vim ];
});
vim-addon-mru = vim-addon-mru.overrideAttrs(old: {
dependencies = ["vim-addon-other" "vim-addon-mw-utils"];
vim-addon-mru = super.vim-addon-mru.overrideAttrs(old: {
dependencies = with super; [ vim-addon-other vim-addon-mw-utils ];
});
vim-addon-nix = vim-addon-nix.overrideAttrs(old: {
dependencies = [
"vim-addon-completion"
"vim-addon-goto-thing-at-cursor"
"vim-addon-errorformats"
"vim-addon-actions"
"vim-addon-mw-utils" "tlib"
vim-addon-nix = super.vim-addon-nix.overrideAttrs(old: {
dependencies = with super; [
vim-addon-completion
vim-addon-goto-thing-at-cursor
vim-addon-errorformats
vim-addon-actions
vim-addon-mw-utils tlib_vim
];
});
vim-addon-sql = vim-addon-sql.overrideAttrs(old: {
dependencies = ["vim-addon-completion" "vim-addon-background-cmd" "tlib"];
vim-addon-sql = super.vim-addon-sql.overrideAttrs(old: {
dependencies = with super; [ vim-addon-completion vim-addon-background-cmd tlib_vim ];
});
vim-addon-syntax-checker = vim-addon-syntax-checker.overrideAttrs(old: {
dependencies = ["vim-addon-mw-utils" "tlib"];
vim-addon-syntax-checker = super.vim-addon-syntax-checker.overrideAttrs(old: {
dependencies = with super; [ vim-addon-mw-utils tlib_vim ];
});
vim-addon-toggle-buffer = vim-addon-toggle-buffer.overrideAttrs(old: {
dependencies = [ "vim-addon-mw-utils" "tlib" ];
vim-addon-toggle-buffer = super.vim-addon-toggle-buffer.overrideAttrs(old: {
dependencies = with super; [ vim-addon-mw-utils tlib_vim ];
});
vim-addon-xdebug = vim-addon-xdebug.overrideAttrs(old: {
dependencies = [ "WebAPI" "vim-addon-mw-utils" "vim-addon-signs" "vim-addon-async" ];
vim-addon-xdebug = super.vim-addon-xdebug.overrideAttrs(old: {
dependencies = with super; [ webapi-vim vim-addon-mw-utils vim-addon-signs vim-addon-async ];
});
vim-bazel = vim-bazel.overrideAttrs(old: {
dependencies = ["maktaba"];
vim-bazel = super.vim-bazel.overrideAttrs(old: {
dependencies = with super; [ vim-maktaba ];
});
vim-codefmt = vim-codefmt.overrideAttrs(old: {
dependencies = ["maktaba"];
vim-codefmt = super.vim-codefmt.overrideAttrs(old: {
dependencies = with super; [ vim-maktaba ];
});
vim-easytags = vim-easytags.overrideAttrs(old: {
dependencies = ["vim-misc"];
vim-easytags = super.vim-easytags.overrideAttrs(old: {
dependencies = with super; [ vim-misc ];
});
# change the go_bin_path to point to a path in the nix store. See the code in
# fatih/vim-go here
# https://github.com/fatih/vim-go/blob/155836d47052ea9c9bac81ba3e937f6f22c8e384/autoload/go/path.vim#L154-L159
vim-go = vim-go.overrideAttrs(old: let
vim-go = super.vim-go.overrideAttrs(old: let
binPath = lib.makeBinPath [
asmfmt
delve
@@ -291,7 +268,7 @@ with generated;
'';
});
vim-grammarous = vim-grammarous.overrideAttrs(old: {
vim-grammarous = super.vim-grammarous.overrideAttrs(old: {
# use `:GrammarousCheck` to initialize checking
# In neovim, you also want to use set
# let g:grammarous#show_first_error = 1
@@ -304,31 +281,31 @@ with generated;
];
});
vim-hier = vim-hier.overrideAttrs(old: {
vim-hier = super.vim-hier.overrideAttrs(old: {
buildInputs = [ vim ];
});
vim-isort = vim-isort.overrideAttrs(old: {
vim-isort = super.vim-isort.overrideAttrs(old: {
postPatch = ''
substituteInPlace ftplugin/python_vimisort.vim \
--replace 'import vim' 'import vim; import sys; sys.path.append("${pythonPackages.isort}/${python.sitePackages}")'
--replace 'import vim' 'import vim; import sys; sys.path.append("${python.pkgs.isort}/${python.sitePackages}")'
'';
});
vim-snipmate = vim-snipmate.overrideAttrs(old: {
dependencies = ["vim-addon-mw-utils" "tlib"];
vim-snipmate = super.vim-snipmate.overrideAttrs(old: {
dependencies = with super; [ vim-addon-mw-utils tlib_vim ];
});
vim-wakatime = vim-wakatime.overrideAttrs(old: {
vim-wakatime = super.vim-wakatime.overrideAttrs(old: {
buildInputs = [ python ];
});
vim-xdebug = vim-xdebug.overrideAttrs(old: {
vim-xdebug = super.vim-xdebug.overrideAttrs(old: {
postInstall = false;
});
vim-xkbswitch = vim-xkbswitch.overrideAttrs(old: {
vim-xkbswitch = super.vim-xkbswitch.overrideAttrs(old: {
patchPhase = ''
substituteInPlace plugin/xkbswitch.vim \
--replace /usr/local/lib/libxkbswitch.so ${xkb_switch}/lib/libxkbswitch.so
@@ -336,14 +313,14 @@ with generated;
buildInputs = [ xkb_switch ];
});
vim-yapf = vim-yapf.overrideAttrs(old: {
vim-yapf = super.vim-yapf.overrideAttrs(old: {
buildPhase = ''
substituteInPlace ftplugin/python_yapf.vim \
--replace '"yapf"' '"${python3Packages.yapf}/bin/yapf"'
--replace '"yapf"' '"${python3.pkgs.yapf}/bin/yapf"'
'';
});
vimproc-vim = vimproc-vim.overrideAttrs(old: {
vimproc-vim = super.vimproc-vim.overrideAttrs(old: {
buildInputs = [ which ];
buildPhase = ''
@@ -355,11 +332,11 @@ with generated;
'';
});
YankRing-vim = YankRing-vim.overrideAttrs(old: {
YankRing-vim = super.YankRing-vim.overrideAttrs(old: {
sourceRoot = ".";
});
youcompleteme = youcompleteme.overrideAttrs(old: {
youcompleteme = super.youcompleteme.overrideAttrs(old: {
buildPhase = ''
substituteInPlace plugin/youcompleteme.vim \
--replace "'ycm_path_to_python_interpreter', '''" \
@@ -378,9 +355,9 @@ with generated;
};
});
jedi-vim = jedi-vim.overrideAttrs(old: {
jedi-vim = super.jedi-vim.overrideAttrs(old: {
# checking for python3 support in vim would be neat, too, but nobody else seems to care
buildInputs = [ python3Packages.jedi ];
buildInputs = [ python3.pkgs.jedi ];
meta = {
description = "code-completion for python using python-jedi";
license = stdenv.lib.licenses.mit;

View File

@@ -296,8 +296,10 @@ def generate_nix(plugins: List[Tuple[str, str, Plugin]]):
f.write(header)
f.write(
"""
{ buildVimPluginFrom2Nix, fetchFromGitHub }:
{ lib, buildVimPluginFrom2Nix, fetchFromGitHub, overrides ? (self: super: {}) }:
let
packages = ( self:
{"""
)
for owner, repo, plugin in sorted_plugins:
@@ -309,7 +311,8 @@ def generate_nix(plugins: List[Tuple[str, str, Plugin]]):
f.write(
f"""
{plugin.normalized_name} = buildVimPluginFrom2Nix {{
name = "{plugin.normalized_name}-{plugin.version}";
pname = "{plugin.normalized_name}";
version = "{plugin.version}";
src = fetchFromGitHub {{
owner = "{owner}";
repo = "{repo}";
@@ -319,7 +322,10 @@ def generate_nix(plugins: List[Tuple[str, str, Plugin]]):
}};
"""
)
f.write("}")
f.write("""
});
in lib.fix' (lib.extends overrides packages)
""")
print("updated generated.nix")

View File

@@ -192,11 +192,13 @@ mkasa/lushtags
morhetz/gruvbox
motus/pig.vim
mpickering/hlint-refactor-vim
natebosch/vim-lsc
nathanaelkane/vim-indent-guides
navicore/vissort.vim
nbouscal/vim-stylish-haskell
ncm2/ncm2
ncm2/ncm2-bufword
ncm2/ncm2-jedi
ncm2/ncm2-path
ncm2/ncm2-tmux
ncm2/ncm2-ultisnips

View File

@@ -1,4 +1,4 @@
{stdenv, vim, vimPlugins, vim_configurable, buildEnv, writeText, writeScriptBin
{stdenv, vim, vimPlugins, vim_configurable, neovim, buildEnv, writeText, writeScriptBin
, nix-prefetch-hg, nix-prefetch-git }:
/*
@@ -150,23 +150,35 @@ vim_with_plugins can be installed like any other application within Nix.
let
inherit (stdenv) lib;
toNames = x:
# transitive closure of plugin dependencies
transitiveClosure = knownPlugins: plugin:
let
# vam puts out a list of strings as the dependency list, we need to be able to deal with that.
# Because of that, "plugin" may be a string or a derivation. If it is a string, it is resolved
# using `knownPlugins`. Otherwise `knownPlugins` can be null.
knownPlugins' = if knownPlugins == null then vimPlugins else knownPlugins;
pluginDrv = if builtins.isString plugin then knownPlugins'.${plugin} else plugin;
in
[ pluginDrv ] ++ (
lib.unique (builtins.concatLists (map (transitiveClosure knownPlugins) pluginDrv.dependencies or []))
);
findDependenciesRecursively = knownPlugins: plugins: lib.concatMap (transitiveClosure knownPlugins) plugins;
attrnamesToPlugins = { knownPlugins, names }:
map (name: if builtins.isString name then knownPlugins.${name} else name) knownPlugins;
pluginToAttrname = plugin:
plugin.pname;
pluginsToAttrnames = plugins: map pluginToAttrname plugins;
vamDictToNames = x:
if builtins.isString x then [x]
else (lib.optional (x ? name) x.name)
++ (x.names or []);
findDependenciesRecursively = {knownPlugins, names}:
let depsOf = name: (builtins.getAttr name knownPlugins).dependencies or [];
recurseNames = path: names: lib.concatMap (name: recurse ([name]++path)) names;
recurse = path:
let name = builtins.head path;
in if builtins.elem name (builtins.tail path)
then throw "recursive vim dependencies"
else [name] ++ recurseNames path (depsOf name);
in lib.uniqList { inputList = recurseNames [] names; };
rtpPath = "share/vim-plugins";
vimrcFile = {
packages ? null,
@@ -183,11 +195,11 @@ let
(let
knownPlugins = pathogen.knownPlugins or vimPlugins;
plugins = map (name: knownPlugins.${name}) (findDependenciesRecursively { inherit knownPlugins; names = pathogen.pluginNames; });
plugins = findDependenciesRecursively knownPlugins pathogen.pluginNames;
pluginsEnv = buildEnv {
name = "pathogen-plugin-env";
paths = map (x: "${x}/${vimPlugins.rtpPath}") plugins;
paths = map (x: "${x}/${rtpPath}") plugins;
};
in
''
@@ -228,7 +240,7 @@ let
(let
knownPlugins = vam.knownPlugins or vimPlugins;
names = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; };
plugins = findDependenciesRecursively knownPlugins (lib.concatMap vamDictToNames vam.pluginDictionaries);
# Vim almost reads JSON, so eventually JSON support should be added to Nix
# TODO: proper quoting
@@ -242,9 +254,9 @@ let
in assert builtins.hasAttr "vim-addon-manager" knownPlugins;
''
let g:nix_plugin_locations = {}
${lib.concatMapStrings (name: ''
let g:nix_plugin_locations['${name}'] = "${knownPlugins.${name}.rtp}"
'') names}
${lib.concatMapStrings (plugin: ''
let g:nix_plugin_locations['${plugin.pname}'] = "${plugin.rtp}"
'') plugins}
let g:nix_plugin_locations['vim-addon-manager'] = "${knownPlugins."vim-addon-manager".rtp}"
let g:vim_addon_manager = {}
@@ -281,8 +293,18 @@ let
(let
link = (packageName: dir: pluginPath: "ln -sf ${pluginPath}/share/vim-plugins/* $out/pack/${packageName}/${dir}");
packageLinks = (packageName: {start ? [], opt ? []}:
let
# `nativeImpl` expects packages to be derivations, not strings (as
# opposed to older implementations that have to maintain backwards
# compatibility). Therefore we don't need to deal with "knownPlugins"
# and can simply pass `null`.
depsOfOptionalPlugins = lib.subtractLists opt (findDependenciesRecursively null opt);
startWithDeps = findDependenciesRecursively null start;
in
["mkdir -p $out/pack/${packageName}/start"]
++ (builtins.map (link packageName "start") start)
# To avoid confusion, even dependencies of optional plugins are added
# to `start` (except if they are explicitly listed as optional plugins).
++ (builtins.map (link packageName "start") (lib.unique (startWithDeps ++ depsOfOptionalPlugins)))
++ ["mkdir -p $out/pack/${packageName}/opt"]
++ (builtins.map (link packageName "opt") opt)
);
@@ -381,62 +403,11 @@ rec {
'';
};
rtpPath = "share/vim-plugins";
vimHelpTags = ''
vimHelpTags(){
if [ -d "$1/doc" ]; then
${vim}/bin/vim -N -u NONE -i NONE -n -E -s -c "helptags $1/doc" +quit! || echo "docs to build failed"
fi
}
'';
addRtp = path: attrs: derivation:
derivation // { rtp = "${derivation}/${path}"; } // {
overrideAttrs = f: buildVimPlugin (attrs // f attrs);
};
buildVimPlugin = a@{
name,
namePrefix ? "vimplugin-",
src,
unpackPhase ? "",
configurePhase ? "",
buildPhase ? "",
preInstall ? "",
postInstall ? "",
path ? (builtins.parseDrvName name).name,
addonInfo ? null,
...
}:
addRtp "${rtpPath}/${path}" a (stdenv.mkDerivation (a // {
name = namePrefix + name;
inherit unpackPhase configurePhase buildPhase addonInfo preInstall postInstall;
installPhase = ''
runHook preInstall
target=$out/${rtpPath}/${path}
mkdir -p $out/${rtpPath}
cp -r . $target
${vimHelpTags}
vimHelpTags $target
if [ -n "$addonInfo" ]; then
echo "$addonInfo" > $target/addon-info.json
fi
runHook postInstall
'';
}));
vim_with_vim2nix = vim_configurable.customize { name = "vim"; vimrcConfig.vam.pluginDictionaries = [ "vim-addon-vim2nix" ]; };
buildVimPluginFrom2Nix = a: buildVimPlugin ({
buildPhase = ":";
configurePhase =":";
} // a);
inherit (import ./build-vim-plugin.nix { inherit stdenv rtpPath vim; }) buildVimPlugin buildVimPluginFrom2Nix;
# used to figure out which python dependencies etc. neovim needs
requiredPlugins = {
packages ? {},
givenKnownPlugins ? null,
@@ -450,13 +421,13 @@ rec {
if vam != null && vam ? knownPlugins then vam.knownPlugins else
if pathogen != null && pathogen ? knownPlugins then pathogen.knownPlugins else
vimPlugins;
pathogenNames = map (name: knownPlugins.${name}) (findDependenciesRecursively { inherit knownPlugins; names = pathogen.pluginNames; });
vamNames = findDependenciesRecursively { inherit knownPlugins; names = lib.concatMap toNames vam.pluginDictionaries; };
names = (lib.optionals (pathogen != null) pathogenNames) ++
(lib.optionals (vam != null) vamNames);
nonNativePlugins = map (name: knownPlugins.${name}) names ++ (lib.optionals (plug != null) plug.plugins);
pathogenPlugins = findDependenciesRecursively knownPlugins pathogen.pluginNames;
vamPlugins = findDependenciesRecursively knownPlugins (lib.concatMap vamDictToNames vam.pluginDictionaries);
nonNativePlugins = (lib.optionals (pathogen != null) pathogenPlugins)
++ (lib.optionals (vam != null) vamPlugins)
++ (lib.optionals (plug != null) plug.plugins);
nativePluginsConfigs = lib.attrsets.attrValues packages;
nativePlugins = lib.concatMap ({start?[], opt?[]}: start++opt) nativePluginsConfigs;
nativePlugins = lib.concatMap ({start?[], opt?[], knownPlugins?vimPlugins}: start++opt) nativePluginsConfigs;
in
nativePlugins ++ nonNativePlugins;
@@ -481,4 +452,9 @@ rec {
name = "vim-with-vim-addon-nix";
vimrcConfig.packages.myVimPackage.start = with vimPlugins; [ vim-nix ];
};
# only neovim makes use of `requiredPlugins`, test this here
test_nvim_with_vim_nix_using_pathogen = neovim.override {
configure.pathogen.pluginNames = [ "vim-nix" ];
};
}