treewide: luaName -> moduleName

Jus to closer align with its usage.
This commit is contained in:
Austin Horstman 2024-12-13 08:28:39 -06:00
parent a7012e7864
commit c37031d71f
No known key found for this signature in database
23 changed files with 31 additions and 31 deletions

View file

@ -73,12 +73,12 @@ A template plugin can be found in (plugins/TEMPLATE.nix)[https://github.com/nix-
| **hasSettings** | Indicating whether the plugin has settings. A `settings` option will be created if true. | No | `true` | | **hasSettings** | Indicating whether the plugin has settings. A `settings` option will be created if true. | No | `true` |
| **imports** | Additional modules to import. | No | `[]` | | **imports** | Additional modules to import. | No | `[]` |
| **isColorscheme** | Indicating whether the plugin is a colorscheme. | No | `false` | | **isColorscheme** | Indicating whether the plugin is a colorscheme. | No | `false` |
| **luaName** | The Lua name for the plugin. | No | `name` parameter | | **moduleName** | The Lua name for the plugin. | No | `name` parameter |
| **maintainers** | Maintainers for the plugin. | No | `[]` | | **maintainers** | Maintainers for the plugin. | No | `[]` |
| **optionsRenamedToSettings** | Options that have been renamed and move to the `settings` attribute. | No | `[]` | | **optionsRenamedToSettings** | Options that have been renamed and move to the `settings` attribute. | No | `[]` |
| **packPathName** | The name of the plugin directory in [packpath](https://neovim.io/doc/user/options.html#'packpath'), usually the plugin's github repo name. E.g. `"foo-bar.nvim"`. | No | `name` parameter | | **packPathName** | The name of the plugin directory in [packpath](https://neovim.io/doc/user/options.html#'packpath'), usually the plugin's github repo name. E.g. `"foo-bar.nvim"`. | No | `name` parameter |
| **package** | The nixpkgs package attr for this plugin. Can be a string, a list of strings, a module option, or any derivation. For example, "foo-bar-nvim" for `pkgs.vimPlugins.foo-bar-nvim`, or `[ "hello" "world" ]` will be referenced as `pkgs.hello.world`. | No | `name` parameter | | **package** | The nixpkgs package attr for this plugin. Can be a string, a list of strings, a module option, or any derivation. For example, "foo-bar-nvim" for `pkgs.vimPlugins.foo-bar-nvim`, or `[ "hello" "world" ]` will be referenced as `pkgs.hello.world`. | No | `name` parameter |
| **settingsDescription** | A description of the settings provided to the `setup` function. | No | `"Options provided to the require('${luaName}')${setup} function."` | | **settingsDescription** | A description of the settings provided to the `setup` function. | No | `"Options provided to the require('${moduleName}')${setup} function."` |
| **settingsExample** | An example configuration for the plugin's settings. | No | `null` | | **settingsExample** | An example configuration for the plugin's settings. | No | `null` |
| **settingsOptions** | Options representing the plugin's settings. This is optional because `settings` is a "freeform" option. See [Declaring plugin options](#declaring-plugin-options). | No | `{}` | | **settingsOptions** | Options representing the plugin's settings. This is optional because `settings` is a "freeform" option. See [Declaring plugin options](#declaring-plugin-options). | No | `{}` |
| **setup** | The setup function for the plugin. | No | `".setup"` | | **setup** | The setup function for the plugin. | No | `".setup"` |

View file

@ -40,11 +40,11 @@
package ? name, package ? name,
settingsOptions ? { }, settingsOptions ? { },
settingsExample ? null, settingsExample ? null,
settingsDescription ? "Options provided to the `require('${luaName}')${setup}` function.", settingsDescription ? "Options provided to the `require('${moduleName}')${setup}` function.",
hasSettings ? true, hasSettings ? true,
extraOptions ? { }, extraOptions ? { },
# config # config
luaName ? name, moduleName ? name,
setup ? ".setup", setup ? ".setup",
extraConfig ? cfg: { }, extraConfig ? cfg: { },
extraPlugins ? [ ], extraPlugins ? [ ],
@ -66,7 +66,7 @@
opts = options.${namespace}.${name}; opts = options.${namespace}.${name};
setupCode = '' setupCode = ''
require('${luaName}')${setup}(${ require('${moduleName}')${setup}(${
lib.optionalString (cfg ? settings) (lib.nixvim.toLuaObject cfg.settings) lib.optionalString (cfg ? settings) (lib.nixvim.toLuaObject cfg.settings)
}) })
''; '';

View file

@ -7,7 +7,7 @@ with lib;
helpers.neovim-plugin.mkNeovimPlugin { helpers.neovim-plugin.mkNeovimPlugin {
name = "better-escape"; name = "better-escape";
packPathName = "better-escape.nvim"; packPathName = "better-escape.nvim";
luaName = "better_escape"; moduleName = "better_escape";
package = "better-escape-nvim"; package = "better-escape-nvim";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ maintainers.GaetanLepage ];

View file

@ -8,7 +8,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "codeium-nvim"; name = "codeium-nvim";
packPathName = "codeium.nvim"; packPathName = "codeium.nvim";
luaName = "codeium"; moduleName = "codeium";
maintainers = with lib.maintainers; [ maintainers = with lib.maintainers; [
GaetanLepage GaetanLepage

View file

@ -7,7 +7,7 @@ with lib;
helpers.neovim-plugin.mkNeovimPlugin { helpers.neovim-plugin.mkNeovimPlugin {
name = "comment"; name = "comment";
packPathName = "Comment.nvim"; packPathName = "Comment.nvim";
luaName = "Comment"; moduleName = "Comment";
package = "comment-nvim"; package = "comment-nvim";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ maintainers.GaetanLepage ];

View file

@ -8,7 +8,7 @@ let
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "conform-nvim"; name = "conform-nvim";
luaName = "conform"; moduleName = "conform";
packPathName = "conform.nvim"; packPathName = "conform.nvim";
maintainers = [ lib.maintainers.khaneliman ]; maintainers = [ lib.maintainers.khaneliman ];

View file

@ -7,7 +7,7 @@ with lib;
helpers.neovim-plugin.mkNeovimPlugin { helpers.neovim-plugin.mkNeovimPlugin {
name = "copilot-chat"; name = "copilot-chat";
packPathName = "CopilotChat.nvim"; packPathName = "CopilotChat.nvim";
luaName = "CopilotChat"; moduleName = "CopilotChat";
package = "CopilotChat-nvim"; package = "CopilotChat-nvim";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ maintainers.GaetanLepage ];

View file

@ -7,7 +7,7 @@ with lib;
helpers.neovim-plugin.mkNeovimPlugin { helpers.neovim-plugin.mkNeovimPlugin {
name = "indent-blankline"; name = "indent-blankline";
packPathName = "indent-blankline.nvim"; packPathName = "indent-blankline.nvim";
luaName = "ibl"; moduleName = "ibl";
package = "indent-blankline-nvim"; package = "indent-blankline-nvim";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ maintainers.GaetanLepage ];

View file

@ -6,7 +6,7 @@
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin { helpers.neovim-plugin.mkNeovimPlugin {
name = "lsp-lines"; name = "lsp-lines";
luaName = "lsp_lines"; moduleName = "lsp_lines";
packPathName = "lsp_lines.nvim"; packPathName = "lsp_lines.nvim";
package = "lsp_lines-nvim"; package = "lsp_lines-nvim";

View file

@ -6,7 +6,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "lsp-signature"; name = "lsp-signature";
packPathName = "lsp_signature.nvim"; packPathName = "lsp_signature.nvim";
package = "lsp_signature-nvim"; package = "lsp_signature-nvim";
luaName = "lsp_signature"; moduleName = "lsp_signature";
maintainers = [ lib.maintainers.wadsaek ]; maintainers = [ lib.maintainers.wadsaek ];

View file

@ -5,7 +5,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "navic"; name = "navic";
packPathName = "nvim-navic"; packPathName = "nvim-navic";
luaName = "nvim-navic"; moduleName = "nvim-navic";
package = "nvim-navic"; package = "nvim-navic";
maintainers = [ lib.maintainers.khaneliman ]; maintainers = [ lib.maintainers.khaneliman ];

View file

@ -7,7 +7,7 @@
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "none-ls"; name = "none-ls";
packPathName = "none-ls.nvim"; packPathName = "none-ls.nvim";
luaName = "null-ls"; moduleName = "null-ls";
package = "none-ls-nvim"; package = "none-ls-nvim";
maintainers = [ lib.maintainers.MattSturgeon ]; maintainers = [ lib.maintainers.MattSturgeon ];

View file

@ -8,7 +8,7 @@ let
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "nvim-snippets"; name = "nvim-snippets";
luaName = "snippets"; moduleName = "snippets";
maintainers = [ lib.maintainers.psfloyd ]; maintainers = [ lib.maintainers.psfloyd ];

View file

@ -7,7 +7,7 @@ let
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "nvim-ufo"; name = "nvim-ufo";
luaName = "ufo"; moduleName = "ufo";
package = "nvim-ufo"; package = "nvim-ufo";
maintainers = [ lib.maintainers.khaneliman ]; maintainers = [ lib.maintainers.khaneliman ];

View file

@ -9,7 +9,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "project-nvim"; name = "project-nvim";
packPathName = "project.nvim"; packPathName = "project.nvim";
luaName = "project_nvim"; moduleName = "project_nvim";
maintainers = [ lib.maintainers.khaneliman ]; maintainers = [ lib.maintainers.khaneliman ];

View file

@ -11,7 +11,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "rest"; name = "rest";
packPathName = "rest.nvim"; packPathName = "rest.nvim";
luaName = "rest-nvim"; moduleName = "rest-nvim";
package = "rest-nvim"; package = "rest-nvim";
maintainers = [ lib.maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];

View file

@ -5,7 +5,7 @@
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "sqlite-lua"; name = "sqlite-lua";
packPathName = "sqlite.lua"; packPathName = "sqlite.lua";
luaName = "sqlite.lua"; moduleName = "sqlite.lua";
package = "sqlite-lua"; package = "sqlite-lua";
maintainers = [ lib.maintainers.khaneliman ]; maintainers = [ lib.maintainers.khaneliman ];

View file

@ -9,7 +9,7 @@ with lib;
helpers.neovim-plugin.mkNeovimPlugin { helpers.neovim-plugin.mkNeovimPlugin {
name = "treesitter"; name = "treesitter";
packPathName = "nvim-treesitter"; packPathName = "nvim-treesitter";
luaName = "nvim-treesitter.configs"; moduleName = "nvim-treesitter.configs";
package = "nvim-treesitter"; package = "nvim-treesitter";
description = '' description = ''

View file

@ -8,7 +8,7 @@ with lib;
helpers.neovim-plugin.mkNeovimPlugin { helpers.neovim-plugin.mkNeovimPlugin {
name = "ts-autotag"; name = "ts-autotag";
packPathName = "nvim-ts-autotag"; packPathName = "nvim-ts-autotag";
luaName = "nvim-ts-autotag"; moduleName = "nvim-ts-autotag";
package = "nvim-ts-autotag"; package = "nvim-ts-autotag";
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ maintainers.GaetanLepage ];

View file

@ -5,7 +5,7 @@ in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "web-devicons"; name = "web-devicons";
packPathName = "nvim-web-devicons"; packPathName = "nvim-web-devicons";
luaName = "nvim-web-devicons"; moduleName = "nvim-web-devicons";
package = "nvim-web-devicons"; package = "nvim-web-devicons";
maintainers = [ lib.maintainers.refaelsh ]; maintainers = [ lib.maintainers.refaelsh ];

View file

@ -6,11 +6,11 @@ let
inherit (lib.nixvim) defaultNullOpts toLuaObject; inherit (lib.nixvim) defaultNullOpts toLuaObject;
name = "base16"; name = "base16";
luaName = "base16-colorscheme"; moduleName = "base16-colorscheme";
packPathName = "base16.nvim"; packPathName = "base16.nvim";
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
inherit name luaName packPathName; inherit name moduleName packPathName;
setup = ".with_config"; setup = ".with_config";
package = "base16-nvim"; package = "base16-nvim";
isColorscheme = true; isColorscheme = true;
@ -145,7 +145,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
`:h nvim-base16-builtin-colorschemes` includes a full list of builtin themes, `:h nvim-base16-builtin-colorschemes` includes a full list of builtin themes,
however the [plugin's source code] may be more up to date. however the [plugin's source code] may be more up to date.
You can access `require('${luaName}')` as `base16` in any raw lua, You can access `require('${moduleName}')` as `base16` in any raw lua,
for example, you could reuse some colors from the builtin colorschemes: for example, you could reuse some colors from the builtin colorschemes:
```nix ```nix
@ -181,7 +181,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
# See https://github.com/RRethy/base16-nvim/blob/6ac181b5733518040a33017dde654059cd771b7c/lua/base16-colorscheme.lua#L107-L125 # See https://github.com/RRethy/base16-nvim/blob/6ac181b5733518040a33017dde654059cd771b7c/lua/base16-colorscheme.lua#L107-L125
colorschemes.base16.luaConfig.content = '' colorschemes.base16.luaConfig.content = ''
do do
local base16 = require('${luaName}') local base16 = require('${moduleName}')
base16.with_config(${toLuaObject cfg.settings}) base16.with_config(${toLuaObject cfg.settings})
base16.setup(${toLuaObject cfg.colorscheme}) base16.setup(${toLuaObject cfg.colorscheme})
end end

View file

@ -2,7 +2,7 @@
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "dracula-nvim"; name = "dracula-nvim";
packPathName = "dracula.nvim "; packPathName = "dracula.nvim ";
luaName = "dracula"; moduleName = "dracula";
colorscheme = "dracula"; colorscheme = "dracula";
isColorscheme = true; isColorscheme = true;

View file

@ -7,7 +7,7 @@ let
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin { lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "modus"; name = "modus";
luaName = "modus-themes"; moduleName = "modus-themes";
packPathName = "modus-themes.nvim"; packPathName = "modus-themes.nvim";
package = "modus-themes-nvim"; package = "modus-themes-nvim";
isColorscheme = true; isColorscheme = true;