From c37031d71ffc6b4cad88871899cb15a40d2e8016 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 13 Dec 2024 08:28:39 -0600 Subject: [PATCH] treewide: luaName -> moduleName Jus to closer align with its usage. --- CONTRIBUTING.md | 8 ++++---- lib/neovim-plugin.nix | 6 +++--- plugins/by-name/better-escape/default.nix | 2 +- plugins/by-name/codeium-nvim/default.nix | 2 +- plugins/by-name/comment/default.nix | 2 +- plugins/by-name/conform-nvim/default.nix | 2 +- plugins/by-name/copilot-chat/default.nix | 2 +- plugins/by-name/indent-blankline/default.nix | 2 +- plugins/by-name/lsp-lines/default.nix | 2 +- plugins/by-name/lsp-signature/default.nix | 2 +- plugins/by-name/navic/default.nix | 2 +- plugins/by-name/none-ls/default.nix | 2 +- plugins/by-name/nvim-snippets/default.nix | 2 +- plugins/by-name/nvim-ufo/default.nix | 2 +- plugins/by-name/project-nvim/default.nix | 2 +- plugins/by-name/rest/default.nix | 2 +- plugins/by-name/sqlite-lua/default.nix | 2 +- plugins/by-name/treesitter/default.nix | 2 +- plugins/by-name/ts-autotag/default.nix | 2 +- plugins/by-name/web-devicons/default.nix | 2 +- plugins/colorschemes/base16/default.nix | 8 ++++---- plugins/colorschemes/dracula-nvim.nix | 2 +- plugins/colorschemes/modus.nix | 2 +- 23 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 159952bcbc..5e5c2275ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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` | | **imports** | Additional modules to import. | No | `[]` | | **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 | `[]` | | **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 | -| **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` | | **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"` | @@ -135,7 +135,7 @@ Such plugins are usually configured via vim globals, but often have no configura | **isColorscheme** | Flag to indicate if the plugin is a colorscheme. | No | `false` | | **maintainers** | The maintainers of the plugin. | No | `[]` | | **optionsRenamedToSettings** | List of options renamed to settings. | 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.vim"`. | 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.vim"`. | 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-vim" for `pkgs.vimPlugins.foo-bar-vim`, or `[ "hello" "world" ]` will be referenced as `pkgs.hello.world`. | No | `name` parameter | | **settingsExample** | Example settings for the plugin. | 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 | `{}` | diff --git a/lib/neovim-plugin.nix b/lib/neovim-plugin.nix index 4c6cd26da6..63a40bd514 100644 --- a/lib/neovim-plugin.nix +++ b/lib/neovim-plugin.nix @@ -40,11 +40,11 @@ package ? name, settingsOptions ? { }, settingsExample ? null, - settingsDescription ? "Options provided to the `require('${luaName}')${setup}` function.", + settingsDescription ? "Options provided to the `require('${moduleName}')${setup}` function.", hasSettings ? true, extraOptions ? { }, # config - luaName ? name, + moduleName ? name, setup ? ".setup", extraConfig ? cfg: { }, extraPlugins ? [ ], @@ -66,7 +66,7 @@ opts = options.${namespace}.${name}; setupCode = '' - require('${luaName}')${setup}(${ + require('${moduleName}')${setup}(${ lib.optionalString (cfg ? settings) (lib.nixvim.toLuaObject cfg.settings) }) ''; diff --git a/plugins/by-name/better-escape/default.nix b/plugins/by-name/better-escape/default.nix index 05c0c6fc07..12bf57ac3b 100644 --- a/plugins/by-name/better-escape/default.nix +++ b/plugins/by-name/better-escape/default.nix @@ -7,7 +7,7 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin { name = "better-escape"; packPathName = "better-escape.nvim"; - luaName = "better_escape"; + moduleName = "better_escape"; package = "better-escape-nvim"; maintainers = [ maintainers.GaetanLepage ]; diff --git a/plugins/by-name/codeium-nvim/default.nix b/plugins/by-name/codeium-nvim/default.nix index 6224e676db..b9a0acf90c 100644 --- a/plugins/by-name/codeium-nvim/default.nix +++ b/plugins/by-name/codeium-nvim/default.nix @@ -8,7 +8,7 @@ in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "codeium-nvim"; packPathName = "codeium.nvim"; - luaName = "codeium"; + moduleName = "codeium"; maintainers = with lib.maintainers; [ GaetanLepage diff --git a/plugins/by-name/comment/default.nix b/plugins/by-name/comment/default.nix index f219213fcf..83591e6d40 100644 --- a/plugins/by-name/comment/default.nix +++ b/plugins/by-name/comment/default.nix @@ -7,7 +7,7 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin { name = "comment"; packPathName = "Comment.nvim"; - luaName = "Comment"; + moduleName = "Comment"; package = "comment-nvim"; maintainers = [ maintainers.GaetanLepage ]; diff --git a/plugins/by-name/conform-nvim/default.nix b/plugins/by-name/conform-nvim/default.nix index 18b22952a9..e34bd1bad5 100644 --- a/plugins/by-name/conform-nvim/default.nix +++ b/plugins/by-name/conform-nvim/default.nix @@ -8,7 +8,7 @@ let in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "conform-nvim"; - luaName = "conform"; + moduleName = "conform"; packPathName = "conform.nvim"; maintainers = [ lib.maintainers.khaneliman ]; diff --git a/plugins/by-name/copilot-chat/default.nix b/plugins/by-name/copilot-chat/default.nix index 6992ee1dcf..485a2415be 100644 --- a/plugins/by-name/copilot-chat/default.nix +++ b/plugins/by-name/copilot-chat/default.nix @@ -7,7 +7,7 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin { name = "copilot-chat"; packPathName = "CopilotChat.nvim"; - luaName = "CopilotChat"; + moduleName = "CopilotChat"; package = "CopilotChat-nvim"; maintainers = [ maintainers.GaetanLepage ]; diff --git a/plugins/by-name/indent-blankline/default.nix b/plugins/by-name/indent-blankline/default.nix index 99a95d8c02..45b5cb8c79 100644 --- a/plugins/by-name/indent-blankline/default.nix +++ b/plugins/by-name/indent-blankline/default.nix @@ -7,7 +7,7 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin { name = "indent-blankline"; packPathName = "indent-blankline.nvim"; - luaName = "ibl"; + moduleName = "ibl"; package = "indent-blankline-nvim"; maintainers = [ maintainers.GaetanLepage ]; diff --git a/plugins/by-name/lsp-lines/default.nix b/plugins/by-name/lsp-lines/default.nix index 03ab04c7f0..df6fd7f108 100644 --- a/plugins/by-name/lsp-lines/default.nix +++ b/plugins/by-name/lsp-lines/default.nix @@ -6,7 +6,7 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin { name = "lsp-lines"; - luaName = "lsp_lines"; + moduleName = "lsp_lines"; packPathName = "lsp_lines.nvim"; package = "lsp_lines-nvim"; diff --git a/plugins/by-name/lsp-signature/default.nix b/plugins/by-name/lsp-signature/default.nix index 80726d54ec..e01bcb0366 100644 --- a/plugins/by-name/lsp-signature/default.nix +++ b/plugins/by-name/lsp-signature/default.nix @@ -6,7 +6,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "lsp-signature"; packPathName = "lsp_signature.nvim"; package = "lsp_signature-nvim"; - luaName = "lsp_signature"; + moduleName = "lsp_signature"; maintainers = [ lib.maintainers.wadsaek ]; diff --git a/plugins/by-name/navic/default.nix b/plugins/by-name/navic/default.nix index b80ff080be..7948519d90 100644 --- a/plugins/by-name/navic/default.nix +++ b/plugins/by-name/navic/default.nix @@ -5,7 +5,7 @@ in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "navic"; packPathName = "nvim-navic"; - luaName = "nvim-navic"; + moduleName = "nvim-navic"; package = "nvim-navic"; maintainers = [ lib.maintainers.khaneliman ]; diff --git a/plugins/by-name/none-ls/default.nix b/plugins/by-name/none-ls/default.nix index 441a01a9b7..582f439f60 100644 --- a/plugins/by-name/none-ls/default.nix +++ b/plugins/by-name/none-ls/default.nix @@ -7,7 +7,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "none-ls"; packPathName = "none-ls.nvim"; - luaName = "null-ls"; + moduleName = "null-ls"; package = "none-ls-nvim"; maintainers = [ lib.maintainers.MattSturgeon ]; diff --git a/plugins/by-name/nvim-snippets/default.nix b/plugins/by-name/nvim-snippets/default.nix index 30c500dc5d..ae27ed7649 100644 --- a/plugins/by-name/nvim-snippets/default.nix +++ b/plugins/by-name/nvim-snippets/default.nix @@ -8,7 +8,7 @@ let in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "nvim-snippets"; - luaName = "snippets"; + moduleName = "snippets"; maintainers = [ lib.maintainers.psfloyd ]; diff --git a/plugins/by-name/nvim-ufo/default.nix b/plugins/by-name/nvim-ufo/default.nix index f791e43fbf..43d72316c9 100644 --- a/plugins/by-name/nvim-ufo/default.nix +++ b/plugins/by-name/nvim-ufo/default.nix @@ -7,7 +7,7 @@ let in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "nvim-ufo"; - luaName = "ufo"; + moduleName = "ufo"; package = "nvim-ufo"; maintainers = [ lib.maintainers.khaneliman ]; diff --git a/plugins/by-name/project-nvim/default.nix b/plugins/by-name/project-nvim/default.nix index 7af2c0f4ca..e1a23c10f9 100644 --- a/plugins/by-name/project-nvim/default.nix +++ b/plugins/by-name/project-nvim/default.nix @@ -9,7 +9,7 @@ in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "project-nvim"; packPathName = "project.nvim"; - luaName = "project_nvim"; + moduleName = "project_nvim"; maintainers = [ lib.maintainers.khaneliman ]; diff --git a/plugins/by-name/rest/default.nix b/plugins/by-name/rest/default.nix index c52ba53ef1..5e5ee6f5c8 100644 --- a/plugins/by-name/rest/default.nix +++ b/plugins/by-name/rest/default.nix @@ -11,7 +11,7 @@ in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "rest"; packPathName = "rest.nvim"; - luaName = "rest-nvim"; + moduleName = "rest-nvim"; package = "rest-nvim"; maintainers = [ lib.maintainers.GaetanLepage ]; diff --git a/plugins/by-name/sqlite-lua/default.nix b/plugins/by-name/sqlite-lua/default.nix index 3700070d56..d8276c9a34 100644 --- a/plugins/by-name/sqlite-lua/default.nix +++ b/plugins/by-name/sqlite-lua/default.nix @@ -5,7 +5,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "sqlite-lua"; packPathName = "sqlite.lua"; - luaName = "sqlite.lua"; + moduleName = "sqlite.lua"; package = "sqlite-lua"; maintainers = [ lib.maintainers.khaneliman ]; diff --git a/plugins/by-name/treesitter/default.nix b/plugins/by-name/treesitter/default.nix index 75fe4324d1..b745ddfc47 100644 --- a/plugins/by-name/treesitter/default.nix +++ b/plugins/by-name/treesitter/default.nix @@ -9,7 +9,7 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin { name = "treesitter"; packPathName = "nvim-treesitter"; - luaName = "nvim-treesitter.configs"; + moduleName = "nvim-treesitter.configs"; package = "nvim-treesitter"; description = '' diff --git a/plugins/by-name/ts-autotag/default.nix b/plugins/by-name/ts-autotag/default.nix index f577760ece..d1de13d04b 100644 --- a/plugins/by-name/ts-autotag/default.nix +++ b/plugins/by-name/ts-autotag/default.nix @@ -8,7 +8,7 @@ with lib; helpers.neovim-plugin.mkNeovimPlugin { name = "ts-autotag"; packPathName = "nvim-ts-autotag"; - luaName = "nvim-ts-autotag"; + moduleName = "nvim-ts-autotag"; package = "nvim-ts-autotag"; maintainers = [ maintainers.GaetanLepage ]; diff --git a/plugins/by-name/web-devicons/default.nix b/plugins/by-name/web-devicons/default.nix index b48aa17ca9..ac2f9ab534 100644 --- a/plugins/by-name/web-devicons/default.nix +++ b/plugins/by-name/web-devicons/default.nix @@ -5,7 +5,7 @@ in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "web-devicons"; packPathName = "nvim-web-devicons"; - luaName = "nvim-web-devicons"; + moduleName = "nvim-web-devicons"; package = "nvim-web-devicons"; maintainers = [ lib.maintainers.refaelsh ]; diff --git a/plugins/colorschemes/base16/default.nix b/plugins/colorschemes/base16/default.nix index a4c65157c0..4faa2aa456 100644 --- a/plugins/colorschemes/base16/default.nix +++ b/plugins/colorschemes/base16/default.nix @@ -6,11 +6,11 @@ let inherit (lib.nixvim) defaultNullOpts toLuaObject; name = "base16"; - luaName = "base16-colorscheme"; + moduleName = "base16-colorscheme"; packPathName = "base16.nvim"; in lib.nixvim.neovim-plugin.mkNeovimPlugin { - inherit name luaName packPathName; + inherit name moduleName packPathName; setup = ".with_config"; package = "base16-nvim"; isColorscheme = true; @@ -145,7 +145,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { `:h nvim-base16-builtin-colorschemes` includes a full list of builtin themes, 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: ```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 colorschemes.base16.luaConfig.content = '' do - local base16 = require('${luaName}') + local base16 = require('${moduleName}') base16.with_config(${toLuaObject cfg.settings}) base16.setup(${toLuaObject cfg.colorscheme}) end diff --git a/plugins/colorschemes/dracula-nvim.nix b/plugins/colorschemes/dracula-nvim.nix index 2d0802eae8..9ec144de9a 100644 --- a/plugins/colorschemes/dracula-nvim.nix +++ b/plugins/colorschemes/dracula-nvim.nix @@ -2,7 +2,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "dracula-nvim"; packPathName = "dracula.nvim "; - luaName = "dracula"; + moduleName = "dracula"; colorscheme = "dracula"; isColorscheme = true; diff --git a/plugins/colorschemes/modus.nix b/plugins/colorschemes/modus.nix index 7d45982eaf..d8b87a8193 100644 --- a/plugins/colorschemes/modus.nix +++ b/plugins/colorschemes/modus.nix @@ -7,7 +7,7 @@ let in lib.nixvim.neovim-plugin.mkNeovimPlugin { name = "modus"; - luaName = "modus-themes"; + moduleName = "modus-themes"; packPathName = "modus-themes.nvim"; package = "modus-themes-nvim"; isColorscheme = true;