From 72a716a79c82f29a117befce028fb22dde6658f8 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 27 Apr 2026 08:14:37 -0500 Subject: [PATCH] docs/neovim: add plugin license notes Explain how to set the license for a plugin that doesn't get detected. --- doc/languages-frameworks/neovim.section.md | 19 +++++++++++++++++++ doc/redirects.json | 3 +++ 2 files changed, 22 insertions(+) diff --git a/doc/languages-frameworks/neovim.section.md b/doc/languages-frameworks/neovim.section.md index 3b0db2c03629..6296a0389ec2 100644 --- a/doc/languages-frameworks/neovim.section.md +++ b/doc/languages-frameworks/neovim.section.md @@ -115,6 +115,25 @@ patch those plugins but expose the necessary configuration under `PLUGIN.passthru.initLua` for neovim plugins. For instance, the `unicode-vim` plugin needs the path towards a unicode database so we expose the following snippet `vim.g.Unicode_data_directory="${self.unicode-vim}/autoload/unicode"` under `vimPlugins.unicode-vim.passthru.initLua`. +### Plugin license overrides {#neovim-plugin-license-overrides} + +Generated Vim and Neovim plugins get their `meta.license` from GitHub license metadata when possible. +Some upstream repositories do not expose a license file that GitHub can detect, or only mention the license in a README. +In those cases, add a manual `meta.license` override in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix). + +For example, if upstream documents that a plugin uses the Vim license but GitHub does not detect it: + +```nix +{ + foo-nvim = super.foo-nvim.overrideAttrs (old: { + meta = old.meta // { + # README says this plugin is distributed under the Vim license. + license = lib.licenses.vim; + }; + }); +} +``` + ## LuaRocks based plugins {#neovim-luarocks-based-plugins} In order to automatically handle plugin dependencies, several Neovim plugins diff --git a/doc/redirects.json b/doc/redirects.json index bf2b4029e8d0..9432997f19af 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -4483,6 +4483,9 @@ "index.html#neovim-plugin-required-snippet", "index.html#vim-plugin-required-snippet" ], + "neovim-plugin-license-overrides": [ + "index.html#neovim-plugin-license-overrides" + ], "updating-plugins-in-nixpkgs": [ "index.html#updating-plugins-in-nixpkgs" ],