diff --git a/plugins/bufferlines/barbar.nix b/plugins/bufferlines/barbar.nix index 8d7b65c3..964c60be 100644 --- a/plugins/bufferlines/barbar.nix +++ b/plugins/bufferlines/barbar.nix @@ -7,6 +7,12 @@ in options.plugins.barbar = { enable = mkEnableOption "Enable barbar.nvim"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.barbar-nvim; + description = "Plugin to use for barbar"; + }; + animations = mkOption { type = types.nullOr types.bool; default = null; @@ -50,7 +56,7 @@ in config = mkIf cfg.enable { extraPlugins = with pkgs.vimPlugins; [ - barbar-nvim nvim-web-devicons + cfg.package nvim-web-devicons ]; # maps = genMaps cfg.keys; diff --git a/plugins/colorschemes/base16.nix b/plugins/colorschemes/base16.nix index 34ae17a2..27786072 100644 --- a/plugins/colorschemes/base16.nix +++ b/plugins/colorschemes/base16.nix @@ -9,6 +9,12 @@ in colorschemes.base16 = { enable = mkEnableOption "Enable base16"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.base16-vim; + description = "Plugin to use for base16"; + }; + useTruecolor = mkOption { type = types.bool; default = true; @@ -31,7 +37,7 @@ in config = mkIf cfg.enable { colorscheme = "base16-${cfg.colorscheme}"; - extraPlugins = [ pkgs.vimPlugins.base16-vim ]; + extraPlugins = [ cfg.package ]; plugins.airline.theme = mkIf (cfg.setUpBar) "base16"; plugins.lightline.colorscheme = null; diff --git a/plugins/colorschemes/gruvbox.nix b/plugins/colorschemes/gruvbox.nix index c8560eae..ac6a65fe 100644 --- a/plugins/colorschemes/gruvbox.nix +++ b/plugins/colorschemes/gruvbox.nix @@ -9,6 +9,12 @@ in colorschemes.gruvbox = { enable = mkEnableOption "Enable gruvbox"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.gruvbox-nvim; + description = "Plugin to use for gruvbox"; + }; + italics = mkEnableOption "Enable italics"; bold = mkEnableOption "Enable bold"; underline = mkEnableOption "Enable underlined text"; @@ -113,7 +119,7 @@ in config = mkIf cfg.enable { colorscheme = "gruvbox"; - extraPlugins = [ pkgs.vimPlugins.gruvbox-nvim ]; + extraPlugins = [ cfg.package ]; globals = { gruvbox_bold = mkIf (!cfg.bold) 0; diff --git a/plugins/colorschemes/nord.nix b/plugins/colorschemes/nord.nix index eaff6e37..d6cc1ff5 100644 --- a/plugins/colorschemes/nord.nix +++ b/plugins/colorschemes/nord.nix @@ -8,6 +8,12 @@ in colorschemes.nord = { enable = mkEnableOption "Enable nord"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nord-nvim; + description = "Plugin to use for nord.nvim"; + }; + contrast = mkEnableOption "Make sidebars and popup menus like nvim-tree and telescope have a different background"; @@ -33,7 +39,7 @@ in config = mkIf cfg.enable { colorscheme = "nord"; - extraPlugins = [ pkgs.vimPlugins.nord-nvim ]; + extraPlugins = [ cfg.package ]; globals = { nord_contrast = mkIf cfg.contrast 1; diff --git a/plugins/colorschemes/one.nix b/plugins/colorschemes/one.nix index 659aeb21..f5e7660f 100644 --- a/plugins/colorschemes/one.nix +++ b/plugins/colorschemes/one.nix @@ -7,12 +7,18 @@ in options = { colorschemes.one = { enable = mkEnableOption "Enable vim-one"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.vim-one; + description = "Plugin to use for one"; + }; }; }; config = mkIf cfg.enable { colorscheme = "one"; - extraPlugins = [ pkgs.vimPlugins.vim-one ]; + extraPlugins = [ cfg.package ]; options = { termguicolors = true; diff --git a/plugins/colorschemes/onedark.nix b/plugins/colorschemes/onedark.nix index 58fb843d..b488ea63 100644 --- a/plugins/colorschemes/onedark.nix +++ b/plugins/colorschemes/onedark.nix @@ -7,12 +7,18 @@ in options = { colorschemes.onedark = { enable = mkEnableOption "Enable onedark"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.onedark-vim; + description = "Plugin to use for one"; + }; }; }; config = mkIf cfg.enable { colorscheme = "onedark"; - extraPlugins = [ pkgs.vimPlugins.onedark-vim ]; + extraPlugins = [ cfg.package ]; options = { termguicolors = true; diff --git a/plugins/colorschemes/tokyonight.nix b/plugins/colorschemes/tokyonight.nix index 6d47bddd..aec6415e 100644 --- a/plugins/colorschemes/tokyonight.nix +++ b/plugins/colorschemes/tokyonight.nix @@ -9,6 +9,11 @@ in options = { colorschemes.tokyonight = { enable = mkEnableOption "Enable tokyonight"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.tokyonight-nvim; + description = "Plugin to use for tokyonight"; + }; style = mkOption { type = style; default = "storm"; @@ -75,7 +80,7 @@ in }; config = mkIf cfg.enable { colorscheme = "tokyonight"; - extraPlugins = [ pkgs.vimPlugins.tokyonight-nvim ]; + extraPlugins = [ cfg.package ]; options = { termguicolors = true; }; extraConfigLuaPre = let diff --git a/plugins/completion/coq.nix b/plugins/completion/coq.nix index 6b338344..59b91319 100644 --- a/plugins/completion/coq.nix +++ b/plugins/completion/coq.nix @@ -11,6 +11,12 @@ in plugins.coq-nvim = { enable = mkEnableOption "Enable coq-nvim"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.coq-nvim; + description = "Plugin to use for coq-nvim"; + }; + installArtifacts = mkEnableOption "Install coq-artifacts"; autoStart = mkOption { @@ -35,7 +41,7 @@ in in mkIf cfg.enable { extraPlugins = [ - plugins.coq-nvim + cfg.package ] ++ optional cfg.installArtifacts plugins.coq-artifacts; plugins.lsp = { preConfig = '' diff --git a/plugins/completion/lspkind.nix b/plugins/completion/lspkind.nix index 6ee84f09..3dc4f8fe 100644 --- a/plugins/completion/lspkind.nix +++ b/plugins/completion/lspkind.nix @@ -7,6 +7,13 @@ in { options.plugins.lspkind = { enable = mkEnableOption "lspkind.nvim"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.lspkind-nvim; + description = "Plugin to use for lspkind.nvim"; + }; + mode = mkOption { type = with types; nullOr (enum [ "text" "text_symbol" "symbol_text" "symbol" ]); default = null; @@ -72,7 +79,7 @@ in } else { }); in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.lspkind-nvim ]; + extraPlugins = [ cfg.package ]; extraConfigLua = optionalString (!doCmp) '' require('lspkind').init(${helpers.toLuaObject options}) diff --git a/plugins/completion/nvim-cmp/default.nix b/plugins/completion/nvim-cmp/default.nix index c8351cf4..65dd2725 100644 --- a/plugins/completion/nvim-cmp/default.nix +++ b/plugins/completion/nvim-cmp/default.nix @@ -17,6 +17,12 @@ in options.plugins.nvim-cmp = { enable = mkEnableOption "Enable nvim-cmp"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nvim-cmp; + description = "Plugin to use for nvim-cmp"; + }; + performance = mkOption { default = null; type = types.nullOr (types.submodule ({ ... }: { @@ -394,7 +400,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.nvim-cmp ]; + extraPlugins = [ cfg.package ]; extraConfigLua = helpers.wrapDo '' local cmp = require('cmp') diff --git a/plugins/git/fugitive.nix b/plugins/git/fugitive.nix index 4ea3dce1..729a7eb2 100644 --- a/plugins/git/fugitive.nix +++ b/plugins/git/fugitive.nix @@ -5,7 +5,7 @@ in with helpers; with lib; mkPlugin attrs { name = "fugitive"; description = "Enable vim-fugitive"; - extraPlugins = [ pkgs.vimPlugins.vim-fugitive ]; + package = pkgs.vimPlugins.vim-fugitive; extraPackages = [ pkgs.git ]; # In typical tpope fashin, this plugin has no config options diff --git a/plugins/git/gitgutter.nix b/plugins/git/gitgutter.nix index 76726a4c..93da29c4 100644 --- a/plugins/git/gitgutter.nix +++ b/plugins/git/gitgutter.nix @@ -9,6 +9,12 @@ in plugins.gitgutter = { enable = mkEnableOption "Enable gitgutter"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.gitgutter; + description = "Plugin to use for gitgutter"; + }; + recommendedSettings = mkOption { type = types.bool; default = true; @@ -170,7 +176,7 @@ in grepCommand = if builtins.isAttrs cfg.grep then cfg.grep.command else cfg.grep; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.gitgutter ]; + extraPlugins = [ cfg.package ]; options = mkIf cfg.recommendedSettings { updatetime = 100; diff --git a/plugins/git/gitsigns.nix b/plugins/git/gitsigns.nix index 368c5f9f..0a6f1ad0 100644 --- a/plugins/git/gitsigns.nix +++ b/plugins/git/gitsigns.nix @@ -44,6 +44,11 @@ with lib; let in { options.plugins.gitsigns = { enable = mkEnableOption "Enable gitsigns plugin"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.gitsigns-nvim; + description = "Plugin to use for gitsigns"; + }; signs = { add = signOptions { hl = "GitSignsAdd"; @@ -363,7 +368,7 @@ in { in mkIf cfg.enable { extraPlugins = with pkgs.vimPlugins; [ - gitsigns-nvim + cfg.package ]; extraConfigLua = let luaFnOrStrToObj = val: diff --git a/plugins/git/neogit.nix b/plugins/git/neogit.nix index 6a3dd3ba..29aec256 100644 --- a/plugins/git/neogit.nix +++ b/plugins/git/neogit.nix @@ -18,6 +18,12 @@ in plugins.neogit = { enable = mkEnableOption "Enable neogit"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.neogit; + description = "Plugin to use for neogit"; + }; + disableSigns = mkOption { description = "Disable signs"; type = types.nullOr types.bool; @@ -217,7 +223,7 @@ in in mkIf cfg.enable { extraPlugins = with pkgs.vimPlugins; [ - neogit + cfg.package plenary-nvim ] ++ optional cfg.integrations.diffview diffview-nvim; diff --git a/plugins/helpers.nix b/plugins/helpers.nix index ab6a9866..70c85d77 100644 --- a/plugins/helpers.nix +++ b/plugins/helpers.nix @@ -69,6 +69,7 @@ rec { mkPlugin = { config, lib, ... }: { name, description, + package ? null, extraPlugins ? [], extraPackages ? [], options ? {}, @@ -81,13 +82,23 @@ rec { name = opt.global; value = if cfg.${name} != null then opt.value cfg.${name} else null; }) options; + # does this evaluate package? + packageOption = if package == null then { } else { + package = mkOption { + type = types.package; + default = package; + description = "Plugin to use for ${name}"; + }; + }; in { options.plugins.${name} = { enable = mkEnableOption description; - } // pluginOptions; + } // packageOption // pluginOptions; config = mkIf cfg.enable { - inherit extraPlugins extraPackages globals; + inherit extraPackages globals; + # does this evaluate package? it would not be desired to evaluate pacakge if we use another package. + extraPlugins = extraPlugins ++ optional (package != null) cfg.package; }; }; diff --git a/plugins/languages/ledger.nix b/plugins/languages/ledger.nix index d5c6a06e..d8aa1b07 100644 --- a/plugins/languages/ledger.nix +++ b/plugins/languages/ledger.nix @@ -3,7 +3,7 @@ with lib; with import ../helpers.nix { lib = lib; }; mkPlugin args { name = "ledger"; description = "Enable ledger language features"; - extraPlugins = [ pkgs.vimPlugins.vim-ledger ]; + package = pkgs.vimPlugins.vim-ledger; options = { maxWidth = mkDefaultOpt { diff --git a/plugins/languages/nix.nix b/plugins/languages/nix.nix index 2443caff..bc5b9340 100644 --- a/plugins/languages/nix.nix +++ b/plugins/languages/nix.nix @@ -5,7 +5,7 @@ in with helpers; with lib; mkPlugin attrs { name = "nix"; description = "Enable nix"; - extraPlugins = [ pkgs.vimPlugins.vim-nix ]; + package = pkgs.vimPlugins.vim-nix; # Possibly add option to disable Treesitter highlighting if this is installed options = {}; diff --git a/plugins/languages/plantuml-syntax.nix b/plugins/languages/plantuml-syntax.nix index edfcab53..a4fef1de 100644 --- a/plugins/languages/plantuml-syntax.nix +++ b/plugins/languages/plantuml-syntax.nix @@ -7,6 +7,13 @@ with lib; { options.plugins.plantuml-syntax = { enable = mkEnableOption "Enable plantuml syntax support"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.plantuml-syntax; + description = "Plugin to use for plantuml-syntax"; + }; + setMakeprg = mkOption { type = types.bool; default = true; @@ -23,7 +30,7 @@ with lib; { cfg = config.plugins.plantuml-syntax; in mkIf cfg.enable { - extraPlugins = with pkgs.vimPlugins; [plantuml-syntax]; + extraPlugins = [ cfg.package ]; globals = { plantuml_set_makeprg = cfg.setMakeprg; diff --git a/plugins/languages/treesitter-context.nix b/plugins/languages/treesitter-context.nix index 35e09ea9..00edf647 100644 --- a/plugins/languages/treesitter-context.nix +++ b/plugins/languages/treesitter-context.nix @@ -1,13 +1,18 @@ -{ - pkgs, - lib, - config, - ... +{ pkgs +, lib +, config +, ... }: with lib; { options.plugins.treesitter-context = { enable = mkEnableOption "Enable nvim-treesitter-context"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nvim-treesitter-context; + description = "Plugin to use for nvim-treesitter-context"; + }; + maxLines = mkOption { type = types.nullOr types.ints.positive; default = null; @@ -15,7 +20,7 @@ with lib; { }; trimScope = mkOption { - type = types.enum ["outer" "inner"]; + type = types.enum [ "outer" "inner" ]; default = "outer"; description = "Which context lines to discard if `max_lines` is exceeded"; }; @@ -28,7 +33,7 @@ with lib; { patterns = mkOption { type = types.attrsOf (types.listOf types.str); - default = {}; + default = { }; description = '' Patterns to use for context delimitation. The 'default' key matches all filetypes ''; @@ -36,16 +41,17 @@ with lib; { exactPatterns = mkOption { type = types.attrsOf types.bool; - default = {}; + default = { }; description = "Treat the coresponding entry in patterns as an exact match"; }; }; - config = let - cfg = config.plugins.treesitter-context; - in + config = + let + cfg = config.plugins.treesitter-context; + in mkIf cfg.enable { - extraPlugins = with pkgs.vimPlugins; [nvim-treesitter-context]; + extraPlugins = [ cfg.package ]; plugins.treesitter.moduleConfig.context = { max_lines = cfg.maxLines; diff --git a/plugins/languages/treesitter-refactor.nix b/plugins/languages/treesitter-refactor.nix index 56b768a3..94bd986e 100644 --- a/plugins/languages/treesitter-refactor.nix +++ b/plugins/languages/treesitter-refactor.nix @@ -1,105 +1,115 @@ -{ - pkgs, - config, - lib, - ... +{ pkgs +, config +, lib +, ... }: with lib; { - options.plugins.treesitter-refactor = let - disable = mkOption { - type = types.listOf types.str; - default = []; - description = "List of languages to disable the module on"; - }; - in { - enable = - mkEnableOption - "Enable treesitter-refactor (requires plugins.treesitter.enable to be true)"; - highlightDefinitions = { - inherit disable; + options.plugins.treesitter-refactor = + let + disable = mkOption { + type = types.listOf types.str; + default = [ ]; + description = "List of languages to disable the module on"; + }; + in + { enable = mkEnableOption - "Highlights definition and usages of the current symbol under the cursor."; - clearOnCursorMove = mkOption { - type = types.bool; - default = true; - description = '' - Controls if highlights should be cleared when the cursor is moved. If your 'updatetime' - is around `100` you can set this to false to have a less laggy experience. + "Enable treesitter-refactor (requires plugins.treesitter.enable to be true)"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nvim-treesitter-refactor; + description = "Plugin to use for treesitter-refactor"; + }; + + highlightDefinitions = { + inherit disable; + enable = + mkEnableOption + "Highlights definition and usages of the current symbol under the cursor."; + clearOnCursorMove = mkOption { + type = types.bool; + default = true; + description = '' + Controls if highlights should be cleared when the cursor is moved. If your 'updatetime' + is around `100` you can set this to false to have a less laggy experience. + ''; + }; + }; + highlightCurrentScope = { + inherit disable; + enable = mkEnableOption "Highlights the block from the current scope where the cursor is."; + }; + smartRename = { + inherit disable; + enable = + mkEnableOption + "Renames the symbol under the cursor within the current scope (and current file)."; + keymaps = { + smartRename = mkOption { + type = types.nullOr types.str; + default = "grr"; + description = "rename symbol under the cursor"; + }; + }; + }; + navigation = { + inherit disable; + enable = mkEnableOption '' + Provides "go to definition" for the symbol under the cursor, + and lists the definitions from the current file. ''; - }; - }; - highlightCurrentScope = { - inherit disable; - enable = mkEnableOption "Highlights the block from the current scope where the cursor is."; - }; - smartRename = { - inherit disable; - enable = - mkEnableOption - "Renames the symbol under the cursor within the current scope (and current file)."; - keymaps = { - smartRename = mkOption { - type = types.nullOr types.str; - default = "grr"; - description = "rename symbol under the cursor"; - }; - }; - }; - navigation = { - inherit disable; - enable = mkEnableOption '' - Provides "go to definition" for the symbol under the cursor, - and lists the definitions from the current file. - ''; - keymaps = { - gotoDefinition = mkOption { - type = types.nullOr types.str; - default = "gnd"; - description = "go to the definition of the symbol under the cursor"; - }; - gotoDefinitionLspFallback = mkOption { - type = types.nullOr types.str; - default = null; - description = '' - go to the definition of the symbol under the cursor or use vim.lsp.buf.definition if - the symbol can not be resolved. You can use your own fallback function if create a - mapping fo `lua require'nvim-treesitter.refactor.navigation(nil, fallback_function)`. - ''; - }; - listDefinitons = mkOption { - type = types.nullOr types.str; - default = "gnD"; - description = "list all definitions from the current file"; - }; - listDefinitonsToc = mkOption { - type = types.nullOr types.str; - default = "gO"; - description = '' - list all definitions from the current file like a table of contents (similar to the one - you see when pressing |gO| in help files). - ''; - }; - gotoNextUsage = mkOption { - type = types.nullOr types.str; - default = ""; - description = "go to next usage of identifier under the cursor"; - }; - gotoPreviousUsage = mkOption { - type = types.nullOr types.str; - default = ""; - description = "go to previous usage of identifier"; + keymaps = { + gotoDefinition = mkOption { + type = types.nullOr types.str; + default = "gnd"; + description = "go to the definition of the symbol under the cursor"; + }; + gotoDefinitionLspFallback = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + go to the definition of the symbol under the cursor or use vim.lsp.buf.definition if + the symbol can not be resolved. You can use your own fallback function if create a + mapping fo `lua require'nvim-treesitter.refactor.navigation(nil, fallback_function)`. + ''; + }; + listDefinitons = mkOption { + type = types.nullOr types.str; + default = "gnD"; + description = "list all definitions from the current file"; + }; + listDefinitonsToc = mkOption { + type = types.nullOr types.str; + default = "gO"; + description = '' + list all definitions from the current file like a table of contents (similar to the one + you see when pressing |gO| in help files). + ''; + }; + gotoNextUsage = mkOption { + type = types.nullOr types.str; + default = ""; + description = "go to next usage of identifier under the cursor"; + }; + gotoPreviousUsage = mkOption { + type = types.nullOr types.str; + default = ""; + description = "go to previous usage of identifier"; + }; }; }; }; - }; - config = let - cfg = config.plugins.treesitter-refactor; - in + config = + let + cfg = config.plugins.treesitter-refactor; + in mkIf cfg.enable { - extraPlugins = with pkgs.vimPlugins; [nvim-treesitter-refactor]; + extraPlugins = [ cfg.package ]; + plugins.treesitter.moduleConfig.refactor = { highlight_definitions = { inherit (cfg.highlightDefinitions) enable disable; @@ -108,20 +118,22 @@ with lib; { highlight_current_scope = cfg.highlightCurrentScope; smart_rename = { inherit (cfg.smartRename) enable disable; - keymaps = {smart_rename = cfg.smartRename.keymaps.smartRename;}; + keymaps = { smart_rename = cfg.smartRename.keymaps.smartRename; }; }; navigation = { inherit (cfg.navigation) enable disable; - keymaps = let - cfgK = cfg.navigation.keymaps; - in { - goto_definition = cfgK.gotoDefinition; - goto_definition_lsp_fallback = cfgK.gotoDefinitionLspFallback; - list_definitions = cfgK.listDefinitons; - list_definitions_toc = cfgK.listDefinitonsToc; - goto_next_usage = cfgK.gotoNextUsage; - goto_previous_usage = cfgK.gotoPreviousUsage; - }; + keymaps = + let + cfgK = cfg.navigation.keymaps; + in + { + goto_definition = cfgK.gotoDefinition; + goto_definition_lsp_fallback = cfgK.gotoDefinitionLspFallback; + list_definitions = cfgK.listDefinitons; + list_definitions_toc = cfgK.listDefinitonsToc; + goto_next_usage = cfgK.gotoNextUsage; + goto_previous_usage = cfgK.gotoPreviousUsage; + }; }; }; }; diff --git a/plugins/languages/treesitter.nix b/plugins/languages/treesitter.nix index 8539af81..eb3f13c6 100644 --- a/plugins/languages/treesitter.nix +++ b/plugins/languages/treesitter.nix @@ -9,6 +9,12 @@ in plugins.treesitter = { enable = mkEnableOption "Enable tree-sitter syntax highlighting"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nvim-treesitter; + description = "Plugin to use for nvim-treesitter. If using nixGrammars, it should include a `withPlugins` function"; + }; + nixGrammars = mkOption { type = types.bool; default = true; @@ -126,8 +132,8 @@ in ''; extraPlugins = with pkgs; if cfg.nixGrammars then - [ (vimPlugins.nvim-treesitter.withPlugins (_: cfg.grammarPackages)) ] - else [ vimPlugins.nvim-treesitter ]; + [ (cfg.package.withPlugins (_: cfg.grammarPackages)) ] + else [ cfg.package ]; extraPackages = [ pkgs.tree-sitter pkgs.nodejs ]; options = mkIf cfg.folding { diff --git a/plugins/languages/zig.nix b/plugins/languages/zig.nix index 282ad53c..e6353cbf 100644 --- a/plugins/languages/zig.nix +++ b/plugins/languages/zig.nix @@ -5,7 +5,7 @@ in with helpers; with lib; mkPlugin attrs { name = "zig"; description = "Enable zig"; - extraPlugins = [ pkgs.vimPlugins.zig-vim ]; + package = pkgs.vimPlugins.zig-vim; # Possibly add option to disable Treesitter highlighting if this is installed options = { diff --git a/plugins/null-ls/default.nix b/plugins/null-ls/default.nix index 5f04c53b..0f9f0688 100644 --- a/plugins/null-ls/default.nix +++ b/plugins/null-ls/default.nix @@ -12,6 +12,12 @@ in options.plugins.null-ls = { enable = mkEnableOption "Enable null-ls"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.null-ls-nvim; + description = "Plugin to use for null-ls"; + }; + debug = mkOption { default = null; type = with types; nullOr bool; @@ -38,7 +44,7 @@ in }; in mkIf cfg.enable { - extraPlugins = with pkgs.vimPlugins; [ null-ls-nvim ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' require("null-ls").setup(${helpers.toLuaObject options}) diff --git a/plugins/null-ls/helpers.nix b/plugins/null-ls/helpers.nix index 0075390e..f8aa0e8c 100644 --- a/plugins/null-ls/helpers.nix +++ b/plugins/null-ls/helpers.nix @@ -4,7 +4,8 @@ { name , sourceType , description ? "Enable ${name} source, for null-ls." - , packages ? [ ] + , package ? null + , extraPackages ? [ ] , ... }: # returns a module @@ -13,6 +14,14 @@ let helpers = import ../helpers.nix args; cfg = config.plugins.null-ls.sources.${sourceType}.${name}; + # does this evaluate package? + packageOption = if package == null then { } else { + package = mkOption { + type = types.package; + default = package; + description = "Package to use for ${name} by null-ls"; + }; + }; in { options.plugins.null-ls.sources.${sourceType}.${name} = { @@ -28,10 +37,11 @@ # '\'{ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }'\' # ''; }; - }; + } // packageOption; config = mkIf cfg.enable { - extraPackages = packages; + # Does this evaluate package? + extraPackages = packages ++ optional (package != null) cfg.package; # Add source to list of sources plugins.null-ls.sourcesItems = diff --git a/plugins/null-ls/servers.nix b/plugins/null-ls/servers.nix index da44c114..41f2a7db 100644 --- a/plugins/null-ls/servers.nix +++ b/plugins/null-ls/servers.nix @@ -8,36 +8,36 @@ let completion = { }; diagnostics = { flake8 = { - packages = [ pkgs.python3Packages.flake8 ]; + package = pkgs.python3Packages.flake8; }; shellcheck = { - packages = [ pkgs.shellcheck ]; + package = pkgs.shellcheck; }; }; formatting = { phpcbf = { - packages = [ pkgs.phpPackages.phpcbf ]; + package = pkgs.phpPackages.phpcbf; }; alejandra = { - packages = [ pkgs.alejandra ]; + package = pkgs.alejandra; }; nixfmt = { - packages = [ pkgs.nixfmt ]; + package = pkgs.nixfmt; }; prettier = { - packages = [ pkgs.nodePackages.prettier ]; + package = pkgs.nodePackages.prettier; }; black = { - packages = [ pkgs.python3Packages.black ]; + package = pkgs.python3Packages.black; }; beautysh = { - packages = [ inputs.beautysh.packages.${pkgs.system}.beautysh-python38 ]; + package = inputs.beautysh.packages.${pkgs.system}.beautysh-python38; }; fourmolu = { - packages = [ pkgs.haskellPackages.fourmolu ]; + package = pkgs.haskellPackages.fourmolu; }; fnlfmt = { - packages = [ pkgs.fnlfmt ]; + package = pkgs.fnlfmt; }; }; }; diff --git a/plugins/nvim-lsp/lsp-lines.nix b/plugins/nvim-lsp/lsp-lines.nix index e415b469..df06930d 100644 --- a/plugins/nvim-lsp/lsp-lines.nix +++ b/plugins/nvim-lsp/lsp-lines.nix @@ -8,6 +8,13 @@ in options = { plugins.lsp-lines = { enable = mkEnableOption "lsp_lines.nvim"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.lsp_lines-nvim; + description = "Plugin to use for lsp_lines.nvim"; + }; + currentLine = mkOption { type = types.bool; default = false; @@ -27,7 +34,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.lsp_lines-nvim ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' do diff --git a/plugins/nvim-lsp/lspsaga.nix b/plugins/nvim-lsp/lspsaga.nix index abd786b9..055a4b30 100644 --- a/plugins/nvim-lsp/lspsaga.nix +++ b/plugins/nvim-lsp/lspsaga.nix @@ -9,6 +9,12 @@ in plugins.lspsaga = { enable = mkEnableOption "Enable lspsava.nvim"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.lspsaga-nvim; + description = "Plugin to use for lspsaga.nvim"; + }; + signs = { use = mkOption { default = true; @@ -195,7 +201,7 @@ in in notEmpty keys; }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.lspsaga-nvim ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' local saga = require 'lspsaga' diff --git a/plugins/nvim-lsp/trouble.nix b/plugins/nvim-lsp/trouble.nix index c21f41bb..d416a0c4 100644 --- a/plugins/nvim-lsp/trouble.nix +++ b/plugins/nvim-lsp/trouble.nix @@ -9,6 +9,12 @@ with lib; options.plugins.trouble = { enable = mkEnableOption "trouble.nvim"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.trouble-nvim; + description = "Plugin to use for trouble-nvim"; + }; + position = helpers.mkNullOrOption (types.enum [ "top" "left" "right" "bottom" ]) "Position of the list"; height = helpers.mkNullOrOption types.int "Height of the trouble list when position is top or bottom"; width = helpers.mkNullOrOption types.int "Width of the trouble list when position is left or right"; @@ -17,7 +23,7 @@ with lib; config = mkIf cfg.enable { extraPlugins = with pkgs.vimPlugins; [ - trouble-nvim + cfg.package nvim-web-devicons ]; }; diff --git a/plugins/snippets/luasnip/default.nix b/plugins/snippets/luasnip/default.nix index 66fcae81..ad720437 100644 --- a/plugins/snippets/luasnip/default.nix +++ b/plugins/snippets/luasnip/default.nix @@ -11,6 +11,7 @@ in package = mkOption { default = pkgs.vimPlugins.luasnip; type = types.package; + description = "Plugin to use for luasnip"; }; fromVscode = mkOption { diff --git a/plugins/statuslines/airline.nix b/plugins/statuslines/airline.nix index 85bb5cfe..d560ed41 100644 --- a/plugins/statuslines/airline.nix +++ b/plugins/statuslines/airline.nix @@ -16,6 +16,12 @@ in plugins.airline = { enable = mkEnableOption "Enable airline"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.vim-airline; + description = "Plguin to use for airline"; + }; + extensions = mkOption { default = null; type = with types; nullOr attrs; @@ -63,7 +69,7 @@ in in mkIf cfg.enable { extraPlugins = with pkgs.vimPlugins; [ - vim-airline + cfg.package ] ++ optional (!isNull cfg.theme) vim-airline-themes; globals = { airline.extensions = cfg.extensions; diff --git a/plugins/statuslines/lightline.nix b/plugins/statuslines/lightline.nix index 5b41595d..08420fd0 100644 --- a/plugins/statuslines/lightline.nix +++ b/plugins/statuslines/lightline.nix @@ -9,6 +9,12 @@ in plugins.lightline = { enable = mkEnableOption "Enable lightline"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.lightline-vim; + description = "Plugin to use for lightline"; + }; + colorscheme = mkOption { type = with types; nullOr str; default = config.colorscheme; @@ -84,7 +90,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.lightline-vim ]; + extraPlugins = [ cfg.package ]; globals.lightline = mkIf (configAttrs != { }) configAttrs; }; } diff --git a/plugins/statuslines/lualine.nix b/plugins/statuslines/lualine.nix index 31454c01..578e06a3 100644 --- a/plugins/statuslines/lualine.nix +++ b/plugins/statuslines/lualine.nix @@ -58,6 +58,12 @@ in plugins.lualine = { enable = mkEnableOption "Enable lualine"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.lualine-nvim; + description = "Plugin to use for lualine"; + }; + theme = mkOption { default = config.colorscheme; type = types.nullOr types.str; @@ -144,7 +150,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.lualine-nvim ]; + extraPlugins = [ cfg.package ]; extraPackages = [ pkgs.git ]; extraConfigLua = ''require("lualine").setup(${helpers.toLuaObject setupOptions})''; diff --git a/plugins/telescope/default.nix b/plugins/telescope/default.nix index 46d1ba3a..45c65f49 100644 --- a/plugins/telescope/default.nix +++ b/plugins/telescope/default.nix @@ -18,6 +18,12 @@ in options.plugins.telescope = { enable = mkEnableOption "Enable telescope.nvim"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.telescope-nvim; + description = "Plugin to use for telescope.nvim"; + }; + highlightTheme = mkOption { type = types.nullOr types.str; description = "The colorscheme to use for syntax highlighting"; @@ -53,7 +59,7 @@ in extraPackages = [ pkgs.bat ]; extraPlugins = with pkgs.vimPlugins; [ - telescope-nvim + cfg.package plenary-nvim popup-nvim ]; diff --git a/plugins/telescope/frecency.nix b/plugins/telescope/frecency.nix index 7b5b6bd2..58e93d1c 100644 --- a/plugins/telescope/frecency.nix +++ b/plugins/telescope/frecency.nix @@ -7,6 +7,12 @@ in options.plugins.telescope.extensions.frecency = { enable = mkEnableOption "Enable frecency"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.telescope-frecency-nvim; + description = "Plugin to use for telescope frecency"; + }; + dbRoot = mkOption { type = types.nullOr types.str; description = "Path to parent directory of custom database location. Defaults to $XDG_DATA_HOME/nvim"; @@ -57,7 +63,7 @@ in in mkIf cfg.enable { extraPackages = [ pkgs.sqlite ]; extraPlugins = with pkgs.vimPlugins; [ - telescope-frecency-nvim + cfg.package sqlite-lua ]; diff --git a/plugins/telescope/fzf-native.nix b/plugins/telescope/fzf-native.nix index 978cfe78..0686f8b2 100644 --- a/plugins/telescope/fzf-native.nix +++ b/plugins/telescope/fzf-native.nix @@ -7,6 +7,12 @@ in options.plugins.telescope.extensions.fzf-native = { enable = mkEnableOption "Enable fzf-native"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.telescope-fzf-native-nvim; + description = "Plugin to use for telescope extension fzf-native"; + }; + fuzzy = mkOption { type = types.nullOr types.bool; description = "Whether to fuzzy search. False will do exact matching"; @@ -36,7 +42,7 @@ in case_mode = cfg.caseMode; }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.telescope-fzf-native-nvim ]; + extraPlugins = [ cfg.package ]; plugins.telescope.enabledExtensions = [ "fzf" ]; plugins.telescope.extensionConfig."fzf" = configuration; diff --git a/plugins/telescope/media-files.nix b/plugins/telescope/media-files.nix index 8d6cd13c..6be5e49d 100644 --- a/plugins/telescope/media-files.nix +++ b/plugins/telescope/media-files.nix @@ -7,6 +7,12 @@ in options.plugins.telescope.extensions.media_files = { enable = mkEnableOption "Enable media_files extension for telescope"; + package = mkOption { + type = types.package; + default = pkgs.vim.telescope-media-files-nvim; + description = "Plugin to use for telescope extension media_files"; + }; + filetypes = mkOption { default = null; type = with types; nullOr (listOf str); @@ -25,7 +31,7 @@ in extraPlugins = with pkgs.vimPlugins; [ popup-nvim plenary-nvim - telescope-media-files-nvim + cfg.package ]; extraPackages = with pkgs; [ diff --git a/plugins/utils/comment-nvim.nix b/plugins/utils/comment-nvim.nix index 8fd3d930..f7c823ed 100644 --- a/plugins/utils/comment-nvim.nix +++ b/plugins/utils/comment-nvim.nix @@ -8,6 +8,13 @@ in options = { plugins.comment-nvim = { enable = mkEnableOption "Enable comment-nvim"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.comment-nvim; + description = "Plugin to use for comment-nvim"; + }; + padding = mkOption { type = types.nullOr types.bool; description = "Add a space b/w comment and the line"; @@ -97,7 +104,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.comment-nvim ]; + extraPlugins = [ cfg.package ]; extraConfigLua = ''require("Comment").setup${helpers.toLuaObject setupOptions}''; }; diff --git a/plugins/utils/commentary.nix b/plugins/utils/commentary.nix index 3923bb3a..406e130c 100644 --- a/plugins/utils/commentary.nix +++ b/plugins/utils/commentary.nix @@ -9,10 +9,16 @@ in options = { plugins.commentary = { enable = mkEnableOption "Enable commentary"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.vim-commentary; + description = "Plugin to use for vim-commentary"; + }; }; }; config = mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.vim-commentary ]; + extraPlugins = [ cfg.package ]; }; } diff --git a/plugins/utils/dashboard.nix b/plugins/utils/dashboard.nix index 7fec95a9..6eb4c97e 100644 --- a/plugins/utils/dashboard.nix +++ b/plugins/utils/dashboard.nix @@ -10,6 +10,12 @@ in plugins.dashboard = { enable = mkEnableOption "Enable dashboard"; + package = { + type = types.package; + default = pkgs.vimPlugins.dashboard-nvim; + description = "Plugin to use for dashboard-nvim"; + }; + header = mkOption { description = "Header text"; type = types.nullOr (types.listOf types.str); @@ -126,7 +132,7 @@ in filteredOptions = filterAttrs (_: v: !isNull v) options; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.dashboard-nvim ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' local dashboard = require("dashboard") diff --git a/plugins/utils/easyescape.nix b/plugins/utils/easyescape.nix index 8604f64d..3c75ebd5 100644 --- a/plugins/utils/easyescape.nix +++ b/plugins/utils/easyescape.nix @@ -8,11 +8,17 @@ in options = { plugins.easyescape = { enable = mkEnableOption "Enable easyescape"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.vim-easyescape; + description = "Plugin to use for easyescape"; + }; }; }; config = mkIf cfg.enable { - extraPlugins = with pkgs.vimPlugins; [ - vim-easyescape + extraPlugins = [ + cfg.package ]; }; } diff --git a/plugins/utils/emmet.nix b/plugins/utils/emmet.nix index 2ac08fe4..6664bc66 100644 --- a/plugins/utils/emmet.nix +++ b/plugins/utils/emmet.nix @@ -10,7 +10,7 @@ in with helpers; mkPlugin attrs { name = "emmet"; description = "Enable emmet"; - extraPlugins = [ pkgs.vimPlugins.emmet-vim ]; + package = pkgs.vimPlugins.emmet-vim; options = { mode = mkDefaultOpt { diff --git a/plugins/utils/endwise.nix b/plugins/utils/endwise.nix index c3c4c22d..1c5beb9b 100644 --- a/plugins/utils/endwise.nix +++ b/plugins/utils/endwise.nix @@ -5,7 +5,7 @@ in with helpers; with lib; mkPlugin attrs { name = "endwise"; description = "Enable vim-endwise"; - extraPlugins = [ pkgs.vimPlugins.vim-endwise ]; + package = pkgs.vimPlugins.vim-endwise; # Yes it's really not configurable options = {}; diff --git a/plugins/utils/floaterm.nix b/plugins/utils/floaterm.nix index a0279ac9..92c7aeec 100644 --- a/plugins/utils/floaterm.nix +++ b/plugins/utils/floaterm.nix @@ -8,6 +8,13 @@ in options = { plugins.floaterm = { enable = mkEnableOption "Enable floaterm"; + + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.vim-floaterm; + description = "Plugin to use for floatterm"; + }; + shell = mkOption { type = types.nullOr types.str; default = null; @@ -64,8 +71,8 @@ in }; }; config = mkIf cfg.enable { - extraPlugins = with pkgs.vimPlugins; [ - vim-floaterm + extraPlugins = [ + cfg.package ]; globals = { floaterm_shell = mkIf (!isNull cfg.shell) cfg.shell; diff --git a/plugins/utils/goyo.nix b/plugins/utils/goyo.nix index 707e119f..5c0406f2 100644 --- a/plugins/utils/goyo.nix +++ b/plugins/utils/goyo.nix @@ -5,7 +5,7 @@ in with helpers; with lib; mkPlugin attrs { name = "goyo"; description = "Enable goyo.vim"; - extraPlugins = [ pkgs.vimPlugins.goyo-vim ]; + package = pkgs.vimPlugins.goyo-vim; options = { width = mkDefaultOpt { diff --git a/plugins/utils/intellitab.nix b/plugins/utils/intellitab.nix index d1a4ccd9..9edca5aa 100644 --- a/plugins/utils/intellitab.nix +++ b/plugins/utils/intellitab.nix @@ -8,11 +8,17 @@ in options = { plugins.intellitab = { enable = mkEnableOption "intellitab.nvim"; + + package = mkOption { + type = types.package; + default = defs.intellitab-nvim; + description = "Plugin to use for intellitab.nvim"; + }; }; }; config = mkIf cfg.enable { - extraPlugins = [ defs.intellitab-nvim ]; + extraPlugins = [ cfg.package ]; maps.insert."" = "lua require([[intellitab]]).indent()"; plugins.treesitter = { diff --git a/plugins/utils/mark-radar.nix b/plugins/utils/mark-radar.nix index f136f01e..5b3e147f 100644 --- a/plugins/utils/mark-radar.nix +++ b/plugins/utils/mark-radar.nix @@ -10,6 +10,12 @@ in options.plugins.mark-radar = { enable = mkEnableOption "Enable mark-radar"; + package = mkOption { + type = types.package; + default = defs.mark-radar; + description = "Plugin to use for mark-radar"; + }; + highlight_background = mkOption { type = with types; nullOr bool; default = null; @@ -40,7 +46,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ defs.mark-radar ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' require("mark-radar").setup(${opts}) diff --git a/plugins/utils/notify.nix b/plugins/utils/notify.nix index eecf0362..1819c90e 100644 --- a/plugins/utils/notify.nix +++ b/plugins/utils/notify.nix @@ -12,6 +12,12 @@ in options.plugins.notify = { enable = mkEnableOption "Enable notify"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nvim-notify; + description = "Plugin to use for notify"; + }; + stages = mkOption { type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]); description = "Animation style"; @@ -64,7 +70,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.nvim-notify ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' vim.notify = require('notify'); require('notify').setup(${helpers.toLuaObject setupOptions}) diff --git a/plugins/utils/nvim-autopairs.nix b/plugins/utils/nvim-autopairs.nix index 391e230d..e37503e2 100644 --- a/plugins/utils/nvim-autopairs.nix +++ b/plugins/utils/nvim-autopairs.nix @@ -8,6 +8,12 @@ in options.plugins.nvim-autopairs = { enable = mkEnableOption "Enable nvim-autopairs"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nvim-autopairs; + description = "Plugin to use for nvim-autopairs"; + }; + pairs = mkOption { type = types.nullOr (types.attrsOf types.str); default = null; @@ -50,7 +56,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.nvim-autopairs ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' require('nvim-autopairs').setup(${helpers.toLuaObject options}) diff --git a/plugins/utils/nvim-tree.nix b/plugins/utils/nvim-tree.nix index 351f49ba..3e2d93c5 100644 --- a/plugins/utils/nvim-tree.nix +++ b/plugins/utils/nvim-tree.nix @@ -8,6 +8,12 @@ in options.plugins.nvim-tree = { enable = mkEnableOption "Enable nvim-tree"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.nvim-tree-lua; + description = "Plugin to use for nvim-tree"; + }; + disableNetrw = mkOption { type = types.nullOr types.bool; default = null; @@ -257,7 +263,7 @@ in in mkIf cfg.enable { extraPlugins = with pkgs.vimPlugins; [ - nvim-tree-lua + cfg.package nvim-web-devicons ]; diff --git a/plugins/utils/project-nvim.nix b/plugins/utils/project-nvim.nix index d81b7251..5d372848 100644 --- a/plugins/utils/project-nvim.nix +++ b/plugins/utils/project-nvim.nix @@ -8,6 +8,12 @@ in options.plugins.project-nvim = helpers.extraOptionsOptions // { enable = mkEnableOption "Enable project.nvim"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.project-nvim; + description = "Plugin to use for project-nvim"; + }; + manualMode = mkOption { type = types.nullOr types.bool; default = null; @@ -70,7 +76,7 @@ in } // cfg.extraOptions; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.project-nvim ]; + extraPlugins = [ cfg.package ]; extraConfigLua = '' require('project_nvim').setup(${helpers.toLuaObject options}) diff --git a/plugins/utils/specs.nix b/plugins/utils/specs.nix index 9ebd3cb6..ab9e01c4 100644 --- a/plugins/utils/specs.nix +++ b/plugins/utils/specs.nix @@ -8,6 +8,12 @@ in options.plugins.specs = { enable = mkEnableOption "Enable specs-nvim"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.specs-nvim; + description = "Plugin to use for specs-nvim"; + }; + show_jumps = mkOption { type = types.bool; default = true; @@ -137,7 +143,7 @@ in }; in mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.specs-nvim ]; + extraPlugins = [ cfg.package ]; highlight.SpecsPopColor.bg = mkIf (!isNull cfg.color) cfg.color; diff --git a/plugins/utils/startify.nix b/plugins/utils/startify.nix index de5d2a98..352ad315 100644 --- a/plugins/utils/startify.nix +++ b/plugins/utils/startify.nix @@ -5,7 +5,7 @@ in with lib; with helpers; mkPlugin args { name = "startify"; description = "Enable startify"; - extraPlugins = [ pkgs.vimPlugins.vim-startify ]; + package = pkgs.vimPlugins.vim-startify; options = { sessionDir = mkDefaultOpt { diff --git a/plugins/utils/surround.nix b/plugins/utils/surround.nix index 716324d2..bf2b7d63 100644 --- a/plugins/utils/surround.nix +++ b/plugins/utils/surround.nix @@ -5,7 +5,7 @@ in with helpers; with lib; mkPlugin attrs { name = "surround"; description = "Enable surround.vim"; - extraPlugins = [ pkgs.vimPlugins.surround ]; + package = pkgs.vimPlugins.surround; options = {}; } diff --git a/plugins/utils/undotree.nix b/plugins/utils/undotree.nix index 11b36054..5c74cc4b 100644 --- a/plugins/utils/undotree.nix +++ b/plugins/utils/undotree.nix @@ -9,6 +9,12 @@ in plugins.undotree = { enable = mkEnableOption "Enable undotree"; + package = mkOption { + type = types.package; + default = pkgs.vimPlugins.undotree; + description = "Plugin to use for undotree"; + }; + windowLayout = mkOption { type = types.nullOr types.int; default = null; @@ -108,7 +114,7 @@ in }; config = mkIf cfg.enable { - extraPlugins = [ pkgs.vimPlugins.undotree ]; + extraPlugins = [ cfg.package ]; globals = { undotree_WindowLayout = mkIf (cfg.windowLayout != null) cfg.windowLayout;