Commit Graph

30 Commits

Author SHA1 Message Date
Matthieu Coudron
0ab2c96429 vimUtils: buildVimPluginFrom2Nix renamed to buildVimPlugin
the `from2Nix` suffix is a legacy from vim2nix but we dont use that anymore. It makes the name of the function unusual and long.
2023-09-27 19:08:38 +02:00
Sandro Jäckel
938de2ab1d
vimPlugins.vim-utils: execute check and doc generation in cross compilation when host can execute the arch 2023-09-12 17:04:09 +02:00
github-actions[bot]
58cfebde3e
Merge staging-next into staging 2023-02-15 00:02:50 +00:00
Felix Buehler
cdb39a86e0 treewide: use optionalString 2023-02-13 21:52:34 +01:00
Artturin
4e3dcf364e treewide: makeSetupHook deps -> propagatedBuildInputs 2023-02-07 21:02:00 +02:00
figsoda
2579a9877a vimUtils.buildVimPlugin: format 2022-12-23 12:37:26 -05:00
Naïm Favier
4e5ebcc3ed
vim-full: rename from vim_configurable
Avoids confusion: `vim-full`'s build-time features are configurable, but both
`vim` and `vim-full` are *customizable* (in the sense of user configuration).
2022-12-09 09:55:55 +01:00
Naïm Favier
de2e3ca3c8
Merge pull request #204128 from ncfavier/vim-python-optional 2022-12-08 21:08:11 +01:00
Sandro Jäckel
fa1413e4bc
vimPlugins.vim-utils: cleanup inputs 2022-12-07 17:35:54 +01:00
Naïm Favier
cda13fae03
vimUtils.packdir: only include python3 if needed
`makeCustomizable` can be called on vim derivations that don't depend on
python, so avoid including python3 in the environment if there are no python3
dependencies.
2022-12-02 17:26:42 +01:00
ilkecan
ef30dee2d6 buildVimPlugin: deprecate rtp attribute 2022-10-09 12:22:03 +02:00
Matthieu Coudron
b02e24b451 vimUtils.packDir: fix build in absence of pname 2022-10-05 10:43:40 +02:00
Matthieu Coudron
aedd12c96a vimUtils.packdir: better merge of plugins
Fixes https://github.com/NixOS/nixpkgs/issues/193070

Basically it was hard to install both
nvim-treesitter.withPlugins (
          plugins: with plugins; [
            tree-sitter-c
            tree-sitter-lua
            tree-sitter-org-nvim
          ]
        ));
and nvim-treesitter

It also simplifies some nix code.
2022-09-29 16:38:14 +02:00
Artturin
c6568adb00 treewide: makeWrapper buildInputs to nativeBuildInputs
most found with https://github.com/siraben/nix-lint
2022-08-16 13:14:19 +03:00
Matthieu Coudron
6bc1f400f4 update requirePlugins 2022-08-09 16:21:59 +02:00
Matthieu Coudron
cda1f8ae46 neovim: pass packpath via the wrapper
Adding "packages" to the neovim distribution triggers the wrapping of
the derivation. This is because it tries to "set packpath/rtp" in the
init.vim.

If we set these arguments via --cmd instead we can avoid to create an
init.vim, which can be useful if we want to wrap an init.lua later on
(in home-manager for instance, we dont want to generate viml code).

Also removes the support for "configure" in makeNeovimConfig and
configure.plug / configure.vam packages in the compatibility layer
'legacyWrapper'.
2022-08-09 16:20:55 +02:00
Matthieu Coudron
0fb2e47b7f vimUtils: improve comments 2022-08-09 12:01:33 +02:00
Matthieu Coudron
eb051d99b0 vimRcContent: remove now unused linkLuaPlugin 2022-08-09 12:01:32 +02:00
Matthieu Coudron
6717d144ec vimRcContent: now throws when using pathogen 2022-08-09 12:00:20 +02:00
Matthieu Coudron
a36e146b7e vimUtils.vimrcContent: throw an error when using pathogen
We want fewer and even no vim package manager in nixpkgs
2022-08-09 12:00:20 +02:00
Matthieu Coudron
341b9564bb vimUtils: remove vam support
having this many (complex) options not only is hard to maintain but I cant see the benefit of these options now that vim supports packages
2022-07-10 20:38:09 +02:00
Matthieu Coudron
ce505a3984
vimPlugins: use lua derivation if it exists (#178180)
Neovim plugins are now more often than not written in lua.
One advantage of the lua ecosystem over vim's is the existence of
luarocks and the rockspec format, which allows to specify a package
dependencies formally.
I would like more neovim plugins to have a formal description,
"rockspec" being the current candidate.
This MR allows to use nix lua packages as neovim plugins, so as to enjoy
every benefit that rockspecs bring:
- dependdency discovery
- ability to run test suite
- luarocks versioning
- rockspec metadata

the vim update.py script will check if an attribute with the vim plugin
pname exists in lua51Packages. If it does, it uses
buildNeovimPluginFrom2Nix on it, which modifies the luarocks config to
do an almost flat install (luarocks will install the package in the lua
folder instead of share/5.1/lua etc).
It also calls toVimPlugin on it to get all the vim plugin niceties.

The list of packages that could benefit from this is available at
https://luarocks.org/labels/neovim
but I hope it grows.
2022-06-19 14:18:16 +02:00
Matthieu Coudron
a1ad235743
vimUtils: deprecate configure.pathogen (#154814)
pathogen does not bring any value compared to vim native packages so
remove it to ease maintainance burden.
2022-06-13 15:25:46 +02:00
Thane Gill
48254fc091 Wrap vi when using makeCustomizable 2022-05-30 00:02:59 +02:00
Matthieu Coudron
0dbca90d41 buildNeovimPluginFrom2Nix: use neovimRequireCheckHook
and removed the addRtp call that was breaking overrideAttrs
2022-05-11 10:42:19 +02:00
Matthieu Coudron
08b6ad0ea5 buildVimPlugin: check that neovim can require the module.
Add:
```
    doInstallCheck = true;
    nvimRequireCheck = "toto";
```
to your vimPluginCall.
2022-05-11 10:42:19 +02:00
Matthieu Coudron
d4894355c1 vim/update.py: distinguish between vim/neovim plugins
I've been working for a long time towards automatic nix dependencies for
neovim plugins (using luarocks rockspecs to discover the said
dependencies).
This is an initial commit to help me complete the missing bits.
buildNeovimPluginFrom2Nix is right now a placeholder which helps me test
in my fork a version that does a flat install of luarocks.

the vim updater will now check for attributes with the same name in the lua package set,
if that's the case the script will generate buildNeovimPluginFrom2Nix.
2022-05-03 00:22:03 +02:00
Matthieu Coudron
9663a29afa buildVimPlugin: add vimCommandCheckHook
Modeled after pythonImportCheckHook, this checks a command can be run once the plugin is installed
2022-04-30 23:54:25 +02:00
Naïm Favier
7ab1fd262f
vimUtils.makeCustomizable: rewrite to include more things
The current wrapper only includes vim, gvim and the man pages
(optionally). This rewrite distinguishes two scenarios, which I expect
cover the majority of use cases:

- standalone mode, when `name != "vim"`, means the user already has a
  vim in scope and only wants to add a customized version with a
  different name. In this case we only include wrappers for `/bin/*vim`.
- non-standalone mode, when `name == "vim"`, means the user expects a
  normal vim package that uses the specified configuration. In this case
  we include everything in the original derivation, with wrappers for
  all the executables that accept a vimrc.
2022-03-25 00:12:02 +01:00
AndersonTorres
3f19fc37a3 Move misc/vim-plugins to applications/editors/vim/plugins 2022-02-24 20:26:07 -03:00