From 901b21c555fa9820393b31ee54ade8cee915c895 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Sun, 20 Aug 2023 16:49:44 +0200 Subject: vimPluginsUpdater: init The nixpkgs documentation mentions how to update out of tree plugins but one problem is that it requires a nixpkgs clone. This makes it more convenient. I've had the need to generate vim plugins and lua overlays for other projects unrelated to nix and this will make updates easier (aka just run `nix run nixpkgs#vimPluginsUpdater -- --proc=1` or with the legacy commands: `nix-shell -p vimPluginsUpdater --run vim-plugins-updater`. I added an optional "nixpkgs" argument to command line parser, which is the path towards a nixpkgs checkout. By default the current folder. update-luarocks-packages: format with black --- doc/languages-frameworks/vim.section.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md index 5e25c1ed423e1..1f3727f552c80 100644 --- a/doc/languages-frameworks/vim.section.md +++ b/doc/languages-frameworks/vim.section.md @@ -212,9 +212,9 @@ Note: this is not possible anymore for Neovim. ## Adding new plugins to nixpkgs {#adding-new-plugins-to-nixpkgs} -Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names). +Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`nix-shell -p vimPluginsUpdater --run vim-plugins-updater`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/updater.nix). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names). -After running `./update.py`, if nvim-treesitter received an update, also run [`nvim-treesitter/update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py) to update the tree sitter grammars for `nvim-treesitter`. +After running the updater, if nvim-treesitter received an update, also run [`nvim-treesitter/update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py) to update the tree sitter grammars for `nvim-treesitter`. Some plugins require overrides in order to function properly. Overrides are placed in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added: @@ -241,7 +241,8 @@ GITHUB_API_TOKEN=my_token ./pkgs/applications/editors/vim/plugins/update.py Alternatively, set the number of processes to a lower count to avoid rate-limiting. ```sh -./pkgs/applications/editors/vim/plugins/update.py --proc 1 + +nix-shell -p vimPluginsUpdater --run 'vim-plugins-updater --proc 1' ``` ## How to maintain an out-of-tree overlay of vim plugins ? {#vim-out-of-tree-overlays} @@ -250,7 +251,7 @@ You can use the updater script to generate basic packages out of a custom vim plugin list: ``` -pkgs/applications/editors/vim/plugins/update.py -i vim-plugin-names -o generated.nix --no-commit +nix-shell -p vimPluginsUpdater --run vim-plugins-updater -i vim-plugin-names -o generated.nix --no-commit ``` with the contents of `vim-plugin-names` being for example: @@ -264,7 +265,7 @@ You can then reference the generated vim plugins via: ```nix myVimPlugins = pkgs.vimPlugins.extend ( - (pkgs.callPackage generated.nix {}) + (pkgs.callPackage ./generated.nix {}) ); ``` -- cgit 1.4.1