diff --git a/plugins/by-name/avante/default.nix b/plugins/by-name/avante/default.nix index fef0f695bc..a76d7eb9eb 100644 --- a/plugins/by-name/avante/default.nix +++ b/plugins/by-name/avante/default.nix @@ -78,7 +78,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { }; }; - extraConfig = _: { + extraConfig = { plugins.avante.luaConfig.pre = '' require('avante_lib').load() ''; diff --git a/plugins/by-name/bufferline/default.nix b/plugins/by-name/bufferline/default.nix index 4bc48ef7b4..54fad72d91 100644 --- a/plugins/by-name/bufferline/default.nix +++ b/plugins/by-name/bufferline/default.nix @@ -654,7 +654,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { }; }; - extraConfig = cfg: { + extraConfig = { # TODO: added 2024-09-20 remove after 24.11 plugins.web-devicons = lib.mkIf ( !( diff --git a/plugins/by-name/edgy/default.nix b/plugins/by-name/edgy/default.nix index 9fe910bbad..0e851763a3 100644 --- a/plugins/by-name/edgy/default.nix +++ b/plugins/by-name/edgy/default.nix @@ -11,7 +11,7 @@ helpers.neovim-plugin.mkNeovimPlugin { maintainers = [ maintainers.GaetanLepage ]; - extraConfig = cfg: { + extraConfig = { # Those options are strongly recommended by the plugin author: # https://github.com/folke/edgy.nvim?tab=readme-ov-file#-installation opts = { diff --git a/plugins/by-name/firenvim/default.nix b/plugins/by-name/firenvim/default.nix index 9217cacea3..616e74e946 100644 --- a/plugins/by-name/firenvim/default.nix +++ b/plugins/by-name/firenvim/default.nix @@ -72,21 +72,17 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { ''; callSetup = false; - extraConfig = - let - opt = options.plugins.firenvim; - in - cfg: { - warnings = - lib.optional - ( - config.performance.combinePlugins.enable - && !(lib.elem "firenvim" config.performance.combinePlugins.standalonePlugins) - ) - '' - Nixvim (plugins.firenvim): Using `performance.combinePlugins` breaks `firenvim`. - Add this plugin to `performance.combinePlugins.standalonePlugins` to prevent any issue. - ''; - globals.firenvim_config = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opt.settings; - }; + extraConfig = cfg: opts: { + warnings = + lib.optional + ( + config.performance.combinePlugins.enable + && !(lib.elem "firenvim" config.performance.combinePlugins.standalonePlugins) + ) + '' + Nixvim (plugins.firenvim): Using `performance.combinePlugins` breaks `firenvim`. + Add this plugin to `performance.combinePlugins.standalonePlugins` to prevent any issue. + ''; + globals.firenvim_config = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opts.settings; + }; } diff --git a/plugins/by-name/fzf-lua/default.nix b/plugins/by-name/fzf-lua/default.nix index 46a24255b6..9b3ede2d2b 100644 --- a/plugins/by-name/fzf-lua/default.nix +++ b/plugins/by-name/fzf-lua/default.nix @@ -101,53 +101,48 @@ helpers.neovim-plugin.mkNeovimPlugin { }; }; - extraConfig = - cfg: - let - opt = options.plugins.fzf-lua; - in - { - # TODO: deprecated 2024-08-29 remove after 24.11 - warnings = lib.optionals opt.iconsEnabled.isDefined [ - '' - The option definition `plugins.fzf-lua.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it. - '' - ]; - # TODO: added 2024-09-20 remove after 24.11 - plugins.web-devicons = - lib.mkIf - ( - opt.iconsEnabled.isDefined - && cfg.iconsEnabled - && !( - config.plugins.mini.enable - && config.plugins.mini.modules ? icons - && config.plugins.mini.mockDevIcons - ) + extraConfig = cfg: opts: { + # TODO: deprecated 2024-08-29 remove after 24.11 + warnings = lib.optionals opts.iconsEnabled.isDefined [ + '' + The option definition `plugins.fzf-lua.iconsEnabled' in ${lib.showFiles opts.iconsEnabled.files} has been deprecated; please remove it. + '' + ]; + # TODO: added 2024-09-20 remove after 24.11 + plugins.web-devicons = + lib.mkIf + ( + opts.iconsEnabled.isDefined + && cfg.iconsEnabled + && !( + config.plugins.mini.enable + && config.plugins.mini.modules ? icons + && config.plugins.mini.mockDevIcons ) - { - enable = lib.mkOverride 1490 true; - }; + ) + { + enable = lib.mkOverride 1490 true; + }; - extraPackages = [ cfg.fzfPackage ]; + extraPackages = [ cfg.fzfPackage ]; - plugins.fzf-lua.settings.__unkeyed_profile = cfg.profile; + plugins.fzf-lua.settings.__unkeyed_profile = cfg.profile; - keymaps = mapAttrsToList ( - key: mapping: - let - actionStr = - if isString mapping then - "${mapping}()" - else - "${mapping.action}(${helpers.toLuaObject mapping.settings})"; - in - { - inherit key; - mode = mapping.mode or "n"; - action.__raw = "function() require('fzf-lua').${actionStr} end"; - options = mapping.options or { }; - } - ) cfg.keymaps; - }; + keymaps = mapAttrsToList ( + key: mapping: + let + actionStr = + if isString mapping then + "${mapping}()" + else + "${mapping.action}(${helpers.toLuaObject mapping.settings})"; + in + { + inherit key; + mode = mapping.mode or "n"; + action.__raw = "function() require('fzf-lua').${actionStr} end"; + options = mapping.options or { }; + } + ) cfg.keymaps; + }; } diff --git a/plugins/by-name/haskell-scope-highlighting/default.nix b/plugins/by-name/haskell-scope-highlighting/default.nix index 5ad65fc0be..e4e47b8565 100644 --- a/plugins/by-name/haskell-scope-highlighting/default.nix +++ b/plugins/by-name/haskell-scope-highlighting/default.nix @@ -12,7 +12,7 @@ helpers.vim-plugin.mkVimPlugin { maintainers = [ lib.maintainers.GaetanLepage ]; - extraConfig = _: { + extraConfig = { warnings = optional (!config.plugins.treesitter.enable) '' Nixvim (plugins.haskell-scope-highlighting): haskell-scope-highlighting needs treesitter to function as intended. Please, enable it by setting `plugins.treesitter.enable` to `true`. diff --git a/plugins/by-name/headlines/default.nix b/plugins/by-name/headlines/default.nix index 7cb57898e8..a0025afdd4 100644 --- a/plugins/by-name/headlines/default.nix +++ b/plugins/by-name/headlines/default.nix @@ -21,7 +21,7 @@ helpers.neovim-plugin.mkNeovimPlugin { markdown.headline_highlights = [ "Headline1" ]; }; - extraConfig = cfg: { + extraConfig = { warnings = optional (!config.plugins.treesitter.enable) '' Nixvim (plugins.headlines): headlines requires `plugins.treesitter` to be enabled with the relevant grammars installed. ''; diff --git a/plugins/by-name/lightline/default.nix b/plugins/by-name/lightline/default.nix index fff1e451d0..76ae43d412 100644 --- a/plugins/by-name/lightline/default.nix +++ b/plugins/by-name/lightline/default.nix @@ -210,7 +210,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { }; callSetup = false; - extraConfig = cfg: { + extraConfig = { globals.lightline = lib.modules.mkAliasAndWrapDefsWithPriority lib.id options.plugins.lightline.settings; }; } diff --git a/plugins/by-name/lsp-lines/default.nix b/plugins/by-name/lsp-lines/default.nix index f24f9c855b..98df8761d2 100644 --- a/plugins/by-name/lsp-lines/default.nix +++ b/plugins/by-name/lsp-lines/default.nix @@ -31,7 +31,7 @@ helpers.neovim-plugin.mkNeovimPlugin { ) ]; - extraConfig = cfg: { + extraConfig = { # Strongly recommended by the plugin, to avoid duplication. diagnostics.virtual_text = mkDefault false; }; diff --git a/plugins/by-name/telescope/extensions/fzf-native.nix b/plugins/by-name/telescope/extensions/fzf-native.nix index f012e1e6cc..e647838e40 100644 --- a/plugins/by-name/telescope/extensions/fzf-native.nix +++ b/plugins/by-name/telescope/extensions/fzf-native.nix @@ -43,7 +43,7 @@ mkExtension { case_mode = "ignore_case"; }; - extraConfig = cfg: { + extraConfig = { # Native library is in build/libfzf.so performance.combinePlugins.pathsToLink = [ "/build" ]; }; diff --git a/plugins/by-name/treesitter-context/default.nix b/plugins/by-name/treesitter-context/default.nix index 1a3c2cfc21..db8f6b755a 100644 --- a/plugins/by-name/treesitter-context/default.nix +++ b/plugins/by-name/treesitter-context/default.nix @@ -96,7 +96,7 @@ helpers.neovim-plugin.mkNeovimPlugin { zindex = 20; }; - extraConfig = cfg: { + extraConfig = { warnings = mkIf (!config.plugins.treesitter.enable) [ "Nixvim: treesitter-context needs treesitter to function as intended" ]; diff --git a/plugins/by-name/ts-autotag/default.nix b/plugins/by-name/ts-autotag/default.nix index 347e9e4c3b..8d731c08d5 100644 --- a/plugins/by-name/ts-autotag/default.nix +++ b/plugins/by-name/ts-autotag/default.nix @@ -36,7 +36,7 @@ helpers.neovim-plugin.mkNeovimPlugin { "skipTags" ]; - extraConfig = cfg: { + extraConfig = { warnings = mkIf (!config.plugins.treesitter.enable) [ "Nixvim: ts-autotag needs treesitter to function as intended" ]; diff --git a/plugins/by-name/which-key/default.nix b/plugins/by-name/which-key/default.nix index a30e5e6370..34b7c95cd7 100644 --- a/plugins/by-name/which-key/default.nix +++ b/plugins/by-name/which-key/default.nix @@ -1,15 +1,9 @@ -{ - lib, - options, - ... -}: +{ lib, ... }: with lib; let inherit (lib) types; inherit (lib.nixvim) defaultNullOpts mkRaw toLuaObject; - opt = options.plugins.which-key; - specExamples = [ # Basic group with custom icon { @@ -583,12 +577,12 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { # TODO: introduced 2024-07-29: remove after 24.11 # NOTE: this may be upgraded to a mkRemoveOptionModule when which-key removes support extraConfig = - cfg: - lib.mkIf opt.registrations.isDefined { + cfg: opts: + lib.mkIf opts.registrations.isDefined { warnings = [ '' nixvim (plugins.which-key): - The option definition `plugins.which-key.registrations' in ${showFiles opt.registrations.files} has been deprecated in which-key v3; please remove it. + The option definition `plugins.which-key.registrations' in ${showFiles opts.registrations.files} has been deprecated in which-key v3; please remove it. You should use `plugins.which-key.settings.spec' instead. Note: the spec format has changed in which-key v3 @@ -596,7 +590,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { '' ]; - plugins.which-key.luaConfig.content = lib.optionalString opt.registrations.isDefined '' + plugins.which-key.luaConfig.content = lib.optionalString opts.registrations.isDefined '' require("which-key").register(${toLuaObject cfg.registrations}) ''; }; diff --git a/plugins/colorschemes/catppuccin.nix b/plugins/colorschemes/catppuccin.nix index f1ae8331c4..5f19cbe578 100644 --- a/plugins/colorschemes/catppuccin.nix +++ b/plugins/colorschemes/catppuccin.nix @@ -316,5 +316,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { }; }; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/colorschemes/everforest.nix b/plugins/colorschemes/everforest.nix index da16486ff0..cf78ee9bb5 100644 --- a/plugins/colorschemes/everforest.nix +++ b/plugins/colorschemes/everforest.nix @@ -251,5 +251,7 @@ lib.nixvim.vim-plugin.mkVimPlugin { }; }; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/colorschemes/melange.nix b/plugins/colorschemes/melange.nix index 16373fa1a5..29667a167a 100644 --- a/plugins/colorschemes/melange.nix +++ b/plugins/colorschemes/melange.nix @@ -10,5 +10,7 @@ lib.nixvim.vim-plugin.mkVimPlugin { maintainers = [ lib.maintainers.GaetanLepage ]; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/colorschemes/modus.nix b/plugins/colorschemes/modus.nix index 94361c8735..e199e8e49b 100644 --- a/plugins/colorschemes/modus.nix +++ b/plugins/colorschemes/modus.nix @@ -108,5 +108,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { on_highlights = "function(highlights, colors) end"; }; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/colorschemes/one.nix b/plugins/colorschemes/one.nix index e9cf12c88c..a2d890f9fa 100644 --- a/plugins/colorschemes/one.nix +++ b/plugins/colorschemes/one.nix @@ -21,5 +21,7 @@ lib.nixvim.vim-plugin.mkVimPlugin { allow_italics = true; }; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/colorschemes/oxocarbon.nix b/plugins/colorschemes/oxocarbon.nix index a520bd18ac..8964616724 100644 --- a/plugins/colorschemes/oxocarbon.nix +++ b/plugins/colorschemes/oxocarbon.nix @@ -10,5 +10,7 @@ lib.nixvim.vim-plugin.mkVimPlugin { maintainers = [ lib.maintainers.GaetanLepage ]; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/colorschemes/rose-pine.nix b/plugins/colorschemes/rose-pine.nix index f37efec148..d8ba7ff6ab 100644 --- a/plugins/colorschemes/rose-pine.nix +++ b/plugins/colorschemes/rose-pine.nix @@ -154,5 +154,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { before_highlight = "function(group, highlight, palette) end"; }; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/colorschemes/tokyonight.nix b/plugins/colorschemes/tokyonight.nix index 4404dbfe19..3ccb2c6d05 100644 --- a/plugins/colorschemes/tokyonight.nix +++ b/plugins/colorschemes/tokyonight.nix @@ -177,5 +177,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { on_highlights = "function(highlights, colors) end"; }; - extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; }; + extraConfig = { + opts.termguicolors = lib.mkDefault true; + }; } diff --git a/plugins/lsp/language-servers/default.nix b/plugins/lsp/language-servers/default.nix index b2a019434c..0faeaf3fdc 100644 --- a/plugins/lsp/language-servers/default.nix +++ b/plugins/lsp/language-servers/default.nix @@ -24,11 +24,9 @@ let }; }; idris2_lsp = { - extraConfig = - cfg: - mkIf cfg.enable { - plugins.idris2.enable = lib.mkDefault true; - }; + extraConfig = { + plugins.idris2.enable = lib.mkDefault true; + }; }; jsonls = { settings = cfg: { json = cfg; }; @@ -115,7 +113,7 @@ let ts_ls = { # NOTE: Provide the plugin default filetypes so that # `plugins.lsp.servers.volar.tslsIntegration` doesn't wipe out the default filetypes - extraConfig = cfg: { + extraConfig = { plugins.lsp.servers.ts_ls = { filetypes = [ "javascript"