Skip to content

Commit

Permalink
treewide: luaName -> moduleName
Browse files Browse the repository at this point in the history
Jus to closer align with its usage.
  • Loading branch information
khaneliman committed Dec 14, 2024
1 parent a7012e7 commit c37031d
Show file tree
Hide file tree
Showing 23 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"` |
Expand Down Expand Up @@ -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 | `{}` |
Expand Down
6 changes: 3 additions & 3 deletions lib/neovim-plugin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? [ ],
Expand All @@ -66,7 +66,7 @@
opts = options.${namespace}.${name};

setupCode = ''
require('${luaName}')${setup}(${
require('${moduleName}')${setup}(${
lib.optionalString (cfg ? settings) (lib.nixvim.toLuaObject cfg.settings)
})
'';
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/better-escape/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/codeium-nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/comment/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/conform-nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/copilot-chat/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/indent-blankline/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/lsp-lines/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/lsp-signature/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];

Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/navic/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/none-ls/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/nvim-snippets/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
in
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "nvim-snippets";
luaName = "snippets";
moduleName = "snippets";

maintainers = [ lib.maintainers.psfloyd ];

Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/nvim-ufo/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/project-nvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];

Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/rest/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/sqlite-lua/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/treesitter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/ts-autotag/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
2 changes: 1 addition & 1 deletion plugins/by-name/web-devicons/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
8 changes: 4 additions & 4 deletions plugins/colorschemes/base16/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/colorschemes/dracula-nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "dracula-nvim";
packPathName = "dracula.nvim ";
luaName = "dracula";
moduleName = "dracula";
colorscheme = "dracula";
isColorscheme = true;

Expand Down
2 changes: 1 addition & 1 deletion plugins/colorschemes/modus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c37031d

Please sign in to comment.