general: add package options (#127)

* barbar: package option

* Base16: package option

* gruvbox: package option

* nord: package option

* one: package option

* onedark: package option

* tokyonight: package option

* nvim-cmp: package option

* coq: package option

* lspkind: package option

* helpers: added package option to mkPlugin

* fugitive: package option

* gitgutter: package option

* gitsigns: package option

* neogit: package option

* ledger: package option

* nix: package option

* plantuml-syntax: package option

* treesitter-context: package option + formatting

* treesitter-refactor: package option + formatting

* treesitter: package option

* zig: package option

* null-ls: package option

* null-ls/servers: package option

* lsp-lines: package option

* lspsaga: package option

* trouble: package option

* luasnip: added description for package option

* airline: package option

* lightline: package option

* lualine: package option

* telescope: package option

* telescope/frecency: package option

* telescope/fzf-native: package option

* telescope/media-files: package option

* comment-nvim: package option

* vim-commentary: package option

* dashboard: package option

* easyescape: package option

* emmet: package option

* endwise: package option

* floaterm: package option

* goyo: package option

* intellitab: package option

* mark-radar: package option

* notify: package option

* nvim-autopairs: package option

* nvim-tree: package option

* project-nvim: package option

* specs: package option

* startify: package option

* surround: package option

* undotree: package option
This commit is contained in:
Alexander Nortung 2023-01-19 10:45:15 +00:00 committed by GitHub
parent 83f6e1647f
commit 3f9effc575
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 457 additions and 180 deletions

View file

@ -7,6 +7,12 @@ in
options.plugins.barbar = { options.plugins.barbar = {
enable = mkEnableOption "Enable barbar.nvim"; enable = mkEnableOption "Enable barbar.nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.barbar-nvim;
description = "Plugin to use for barbar";
};
animations = mkOption { animations = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = null; default = null;
@ -50,7 +56,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
barbar-nvim nvim-web-devicons cfg.package nvim-web-devicons
]; ];
# maps = genMaps cfg.keys; # maps = genMaps cfg.keys;

View file

@ -9,6 +9,12 @@ in
colorschemes.base16 = { colorschemes.base16 = {
enable = mkEnableOption "Enable base16"; enable = mkEnableOption "Enable base16";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.base16-vim;
description = "Plugin to use for base16";
};
useTruecolor = mkOption { useTruecolor = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -31,7 +37,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
colorscheme = "base16-${cfg.colorscheme}"; colorscheme = "base16-${cfg.colorscheme}";
extraPlugins = [ pkgs.vimPlugins.base16-vim ]; extraPlugins = [ cfg.package ];
plugins.airline.theme = mkIf (cfg.setUpBar) "base16"; plugins.airline.theme = mkIf (cfg.setUpBar) "base16";
plugins.lightline.colorscheme = null; plugins.lightline.colorscheme = null;

View file

@ -9,6 +9,12 @@ in
colorschemes.gruvbox = { colorschemes.gruvbox = {
enable = mkEnableOption "Enable 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"; italics = mkEnableOption "Enable italics";
bold = mkEnableOption "Enable bold"; bold = mkEnableOption "Enable bold";
underline = mkEnableOption "Enable underlined text"; underline = mkEnableOption "Enable underlined text";
@ -113,7 +119,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
colorscheme = "gruvbox"; colorscheme = "gruvbox";
extraPlugins = [ pkgs.vimPlugins.gruvbox-nvim ]; extraPlugins = [ cfg.package ];
globals = { globals = {
gruvbox_bold = mkIf (!cfg.bold) 0; gruvbox_bold = mkIf (!cfg.bold) 0;

View file

@ -8,6 +8,12 @@ in
colorschemes.nord = { colorschemes.nord = {
enable = mkEnableOption "Enable nord"; enable = mkEnableOption "Enable nord";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nord-nvim;
description = "Plugin to use for nord.nvim";
};
contrast = mkEnableOption contrast = mkEnableOption
"Make sidebars and popup menus like nvim-tree and telescope have a different background"; "Make sidebars and popup menus like nvim-tree and telescope have a different background";
@ -33,7 +39,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
colorscheme = "nord"; colorscheme = "nord";
extraPlugins = [ pkgs.vimPlugins.nord-nvim ]; extraPlugins = [ cfg.package ];
globals = { globals = {
nord_contrast = mkIf cfg.contrast 1; nord_contrast = mkIf cfg.contrast 1;

View file

@ -7,12 +7,18 @@ in
options = { options = {
colorschemes.one = { colorschemes.one = {
enable = mkEnableOption "Enable vim-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 { config = mkIf cfg.enable {
colorscheme = "one"; colorscheme = "one";
extraPlugins = [ pkgs.vimPlugins.vim-one ]; extraPlugins = [ cfg.package ];
options = { options = {
termguicolors = true; termguicolors = true;

View file

@ -7,12 +7,18 @@ in
options = { options = {
colorschemes.onedark = { colorschemes.onedark = {
enable = mkEnableOption "Enable 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 { config = mkIf cfg.enable {
colorscheme = "onedark"; colorscheme = "onedark";
extraPlugins = [ pkgs.vimPlugins.onedark-vim ]; extraPlugins = [ cfg.package ];
options = { options = {
termguicolors = true; termguicolors = true;

View file

@ -9,6 +9,11 @@ in
options = { options = {
colorschemes.tokyonight = { colorschemes.tokyonight = {
enable = mkEnableOption "Enable tokyonight"; enable = mkEnableOption "Enable tokyonight";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.tokyonight-nvim;
description = "Plugin to use for tokyonight";
};
style = mkOption { style = mkOption {
type = style; type = style;
default = "storm"; default = "storm";
@ -75,7 +80,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
colorscheme = "tokyonight"; colorscheme = "tokyonight";
extraPlugins = [ pkgs.vimPlugins.tokyonight-nvim ]; extraPlugins = [ cfg.package ];
options = { termguicolors = true; }; options = { termguicolors = true; };
extraConfigLuaPre = extraConfigLuaPre =
let let

View file

@ -11,6 +11,12 @@ in
plugins.coq-nvim = { plugins.coq-nvim = {
enable = mkEnableOption "Enable 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"; installArtifacts = mkEnableOption "Install coq-artifacts";
autoStart = mkOption { autoStart = mkOption {
@ -35,7 +41,7 @@ in
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ extraPlugins = [
plugins.coq-nvim cfg.package
] ++ optional cfg.installArtifacts plugins.coq-artifacts; ] ++ optional cfg.installArtifacts plugins.coq-artifacts;
plugins.lsp = { plugins.lsp = {
preConfig = '' preConfig = ''

View file

@ -7,6 +7,13 @@ in
{ {
options.plugins.lspkind = { options.plugins.lspkind = {
enable = mkEnableOption "lspkind.nvim"; enable = mkEnableOption "lspkind.nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lspkind-nvim;
description = "Plugin to use for lspkind.nvim";
};
mode = mkOption { mode = mkOption {
type = with types; nullOr (enum [ "text" "text_symbol" "symbol_text" "symbol" ]); type = with types; nullOr (enum [ "text" "text_symbol" "symbol_text" "symbol" ]);
default = null; default = null;
@ -72,7 +79,7 @@ in
} else { }); } else { });
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.lspkind-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = optionalString (!doCmp) '' extraConfigLua = optionalString (!doCmp) ''
require('lspkind').init(${helpers.toLuaObject options}) require('lspkind').init(${helpers.toLuaObject options})

View file

@ -17,6 +17,12 @@ in
options.plugins.nvim-cmp = { options.plugins.nvim-cmp = {
enable = mkEnableOption "Enable 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 { performance = mkOption {
default = null; default = null;
type = types.nullOr (types.submodule ({ ... }: { type = types.nullOr (types.submodule ({ ... }: {
@ -394,7 +400,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.nvim-cmp ]; extraPlugins = [ cfg.package ];
extraConfigLua = helpers.wrapDo '' extraConfigLua = helpers.wrapDo ''
local cmp = require('cmp') local cmp = require('cmp')

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs { mkPlugin attrs {
name = "fugitive"; name = "fugitive";
description = "Enable vim-fugitive"; description = "Enable vim-fugitive";
extraPlugins = [ pkgs.vimPlugins.vim-fugitive ]; package = pkgs.vimPlugins.vim-fugitive;
extraPackages = [ pkgs.git ]; extraPackages = [ pkgs.git ];
# In typical tpope fashin, this plugin has no config options # In typical tpope fashin, this plugin has no config options

View file

@ -9,6 +9,12 @@ in
plugins.gitgutter = { plugins.gitgutter = {
enable = mkEnableOption "Enable gitgutter"; enable = mkEnableOption "Enable gitgutter";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.gitgutter;
description = "Plugin to use for gitgutter";
};
recommendedSettings = mkOption { recommendedSettings = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -170,7 +176,7 @@ in
grepCommand = if builtins.isAttrs cfg.grep then cfg.grep.command else cfg.grep; grepCommand = if builtins.isAttrs cfg.grep then cfg.grep.command else cfg.grep;
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.gitgutter ]; extraPlugins = [ cfg.package ];
options = mkIf cfg.recommendedSettings { options = mkIf cfg.recommendedSettings {
updatetime = 100; updatetime = 100;

View file

@ -44,6 +44,11 @@ with lib; let
in { in {
options.plugins.gitsigns = { options.plugins.gitsigns = {
enable = mkEnableOption "Enable gitsigns plugin"; enable = mkEnableOption "Enable gitsigns plugin";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.gitsigns-nvim;
description = "Plugin to use for gitsigns";
};
signs = { signs = {
add = signOptions { add = signOptions {
hl = "GitSignsAdd"; hl = "GitSignsAdd";
@ -363,7 +368,7 @@ in {
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
gitsigns-nvim cfg.package
]; ];
extraConfigLua = let extraConfigLua = let
luaFnOrStrToObj = val: luaFnOrStrToObj = val:

View file

@ -18,6 +18,12 @@ in
plugins.neogit = { plugins.neogit = {
enable = mkEnableOption "Enable neogit"; enable = mkEnableOption "Enable neogit";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.neogit;
description = "Plugin to use for neogit";
};
disableSigns = mkOption { disableSigns = mkOption {
description = "Disable signs"; description = "Disable signs";
type = types.nullOr types.bool; type = types.nullOr types.bool;
@ -217,7 +223,7 @@ in
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
neogit cfg.package
plenary-nvim plenary-nvim
] ++ optional cfg.integrations.diffview diffview-nvim; ] ++ optional cfg.integrations.diffview diffview-nvim;

View file

@ -69,6 +69,7 @@ rec {
mkPlugin = { config, lib, ... }: { mkPlugin = { config, lib, ... }: {
name, name,
description, description,
package ? null,
extraPlugins ? [], extraPlugins ? [],
extraPackages ? [], extraPackages ? [],
options ? {}, options ? {},
@ -81,13 +82,23 @@ rec {
name = opt.global; name = opt.global;
value = if cfg.${name} != null then opt.value cfg.${name} else null; value = if cfg.${name} != null then opt.value cfg.${name} else null;
}) options; }) 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 { in {
options.plugins.${name} = { options.plugins.${name} = {
enable = mkEnableOption description; enable = mkEnableOption description;
} // pluginOptions; } // packageOption // pluginOptions;
config = mkIf cfg.enable { 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;
}; };
}; };

View file

@ -3,7 +3,7 @@ with lib; with import ../helpers.nix { lib = lib; };
mkPlugin args { mkPlugin args {
name = "ledger"; name = "ledger";
description = "Enable ledger language features"; description = "Enable ledger language features";
extraPlugins = [ pkgs.vimPlugins.vim-ledger ]; package = pkgs.vimPlugins.vim-ledger;
options = { options = {
maxWidth = mkDefaultOpt { maxWidth = mkDefaultOpt {

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs { mkPlugin attrs {
name = "nix"; name = "nix";
description = "Enable 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 # Possibly add option to disable Treesitter highlighting if this is installed
options = {}; options = {};

View file

@ -7,6 +7,13 @@
with lib; { with lib; {
options.plugins.plantuml-syntax = { options.plugins.plantuml-syntax = {
enable = mkEnableOption "Enable plantuml syntax support"; 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 { setMakeprg = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -23,7 +30,7 @@ with lib; {
cfg = config.plugins.plantuml-syntax; cfg = config.plugins.plantuml-syntax;
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [plantuml-syntax]; extraPlugins = [ cfg.package ];
globals = { globals = {
plantuml_set_makeprg = cfg.setMakeprg; plantuml_set_makeprg = cfg.setMakeprg;

View file

@ -1,13 +1,18 @@
{ { pkgs
pkgs, , lib
lib, , config
config, , ...
...
}: }:
with lib; { with lib; {
options.plugins.treesitter-context = { options.plugins.treesitter-context = {
enable = mkEnableOption "Enable nvim-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 { maxLines = mkOption {
type = types.nullOr types.ints.positive; type = types.nullOr types.ints.positive;
default = null; default = null;
@ -15,7 +20,7 @@ with lib; {
}; };
trimScope = mkOption { trimScope = mkOption {
type = types.enum ["outer" "inner"]; type = types.enum [ "outer" "inner" ];
default = "outer"; default = "outer";
description = "Which context lines to discard if `max_lines` is exceeded"; description = "Which context lines to discard if `max_lines` is exceeded";
}; };
@ -28,7 +33,7 @@ with lib; {
patterns = mkOption { patterns = mkOption {
type = types.attrsOf (types.listOf types.str); type = types.attrsOf (types.listOf types.str);
default = {}; default = { };
description = '' description = ''
Patterns to use for context delimitation. The 'default' key matches all filetypes Patterns to use for context delimitation. The 'default' key matches all filetypes
''; '';
@ -36,16 +41,17 @@ with lib; {
exactPatterns = mkOption { exactPatterns = mkOption {
type = types.attrsOf types.bool; type = types.attrsOf types.bool;
default = {}; default = { };
description = "Treat the coresponding entry in patterns as an exact match"; description = "Treat the coresponding entry in patterns as an exact match";
}; };
}; };
config = let config =
cfg = config.plugins.treesitter-context; let
in cfg = config.plugins.treesitter-context;
in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [nvim-treesitter-context]; extraPlugins = [ cfg.package ];
plugins.treesitter.moduleConfig.context = { plugins.treesitter.moduleConfig.context = {
max_lines = cfg.maxLines; max_lines = cfg.maxLines;

View file

@ -1,105 +1,115 @@
{ { pkgs
pkgs, , config
config, , lib
lib, , ...
...
}: }:
with lib; { with lib; {
options.plugins.treesitter-refactor = let options.plugins.treesitter-refactor =
disable = mkOption { let
type = types.listOf types.str; disable = mkOption {
default = []; type = types.listOf types.str;
description = "List of languages to disable the module on"; default = [ ];
}; description = "List of languages to disable the module on";
in { };
enable = in
mkEnableOption {
"Enable treesitter-refactor (requires plugins.treesitter.enable to be true)";
highlightDefinitions = {
inherit disable;
enable = enable =
mkEnableOption mkEnableOption
"Highlights definition and usages of the current symbol under the cursor."; "Enable treesitter-refactor (requires plugins.treesitter.enable to be true)";
clearOnCursorMove = mkOption {
type = types.bool; package = mkOption {
default = true; type = types.package;
description = '' default = pkgs.vimPlugins.nvim-treesitter-refactor;
Controls if highlights should be cleared when the cursor is moved. If your 'updatetime' description = "Plugin to use for treesitter-refactor";
is around `100` you can set this to false to have a less laggy experience. };
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 = { keymaps = {
gotoDefinition = mkOption { gotoDefinition = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = "gnd"; default = "gnd";
description = "go to the definition of the symbol under the cursor"; description = "go to the definition of the symbol under the cursor";
}; };
gotoDefinitionLspFallback = mkOption { gotoDefinitionLspFallback = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
description = '' description = ''
go to the definition of the symbol under the cursor or use vim.lsp.buf.definition if 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 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)<cr>`. mapping fo `lua require'nvim-treesitter.refactor.navigation(nil, fallback_function)<cr>`.
''; '';
}; };
listDefinitons = mkOption { listDefinitons = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = "gnD"; default = "gnD";
description = "list all definitions from the current file"; description = "list all definitions from the current file";
}; };
listDefinitonsToc = mkOption { listDefinitonsToc = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = "gO"; default = "gO";
description = '' description = ''
list all definitions from the current file like a table of contents (similar to the one list all definitions from the current file like a table of contents (similar to the one
you see when pressing |gO| in help files). you see when pressing |gO| in help files).
''; '';
}; };
gotoNextUsage = mkOption { gotoNextUsage = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = "<a-*>"; default = "<a-*>";
description = "go to next usage of identifier under the cursor"; description = "go to next usage of identifier under the cursor";
}; };
gotoPreviousUsage = mkOption { gotoPreviousUsage = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = "<a-#>"; default = "<a-#>";
description = "go to previous usage of identifier"; description = "go to previous usage of identifier";
};
}; };
}; };
}; };
};
config = let config =
cfg = config.plugins.treesitter-refactor; let
in cfg = config.plugins.treesitter-refactor;
in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [nvim-treesitter-refactor]; extraPlugins = [ cfg.package ];
plugins.treesitter.moduleConfig.refactor = { plugins.treesitter.moduleConfig.refactor = {
highlight_definitions = { highlight_definitions = {
inherit (cfg.highlightDefinitions) enable disable; inherit (cfg.highlightDefinitions) enable disable;
@ -108,20 +118,22 @@ with lib; {
highlight_current_scope = cfg.highlightCurrentScope; highlight_current_scope = cfg.highlightCurrentScope;
smart_rename = { smart_rename = {
inherit (cfg.smartRename) enable disable; inherit (cfg.smartRename) enable disable;
keymaps = {smart_rename = cfg.smartRename.keymaps.smartRename;}; keymaps = { smart_rename = cfg.smartRename.keymaps.smartRename; };
}; };
navigation = { navigation = {
inherit (cfg.navigation) enable disable; inherit (cfg.navigation) enable disable;
keymaps = let keymaps =
cfgK = cfg.navigation.keymaps; let
in { cfgK = cfg.navigation.keymaps;
goto_definition = cfgK.gotoDefinition; in
goto_definition_lsp_fallback = cfgK.gotoDefinitionLspFallback; {
list_definitions = cfgK.listDefinitons; goto_definition = cfgK.gotoDefinition;
list_definitions_toc = cfgK.listDefinitonsToc; goto_definition_lsp_fallback = cfgK.gotoDefinitionLspFallback;
goto_next_usage = cfgK.gotoNextUsage; list_definitions = cfgK.listDefinitons;
goto_previous_usage = cfgK.gotoPreviousUsage; list_definitions_toc = cfgK.listDefinitonsToc;
}; goto_next_usage = cfgK.gotoNextUsage;
goto_previous_usage = cfgK.gotoPreviousUsage;
};
}; };
}; };
}; };

View file

@ -9,6 +9,12 @@ in
plugins.treesitter = { plugins.treesitter = {
enable = mkEnableOption "Enable tree-sitter syntax highlighting"; 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 { nixGrammars = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -126,8 +132,8 @@ in
''; '';
extraPlugins = with pkgs; if cfg.nixGrammars then extraPlugins = with pkgs; if cfg.nixGrammars then
[ (vimPlugins.nvim-treesitter.withPlugins (_: cfg.grammarPackages)) ] [ (cfg.package.withPlugins (_: cfg.grammarPackages)) ]
else [ vimPlugins.nvim-treesitter ]; else [ cfg.package ];
extraPackages = [ pkgs.tree-sitter pkgs.nodejs ]; extraPackages = [ pkgs.tree-sitter pkgs.nodejs ];
options = mkIf cfg.folding { options = mkIf cfg.folding {

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs { mkPlugin attrs {
name = "zig"; name = "zig";
description = "Enable 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 # Possibly add option to disable Treesitter highlighting if this is installed
options = { options = {

View file

@ -12,6 +12,12 @@ in
options.plugins.null-ls = { options.plugins.null-ls = {
enable = mkEnableOption "Enable 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 { debug = mkOption {
default = null; default = null;
type = with types; nullOr bool; type = with types; nullOr bool;
@ -38,7 +44,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ null-ls-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
require("null-ls").setup(${helpers.toLuaObject options}) require("null-ls").setup(${helpers.toLuaObject options})

View file

@ -4,7 +4,8 @@
{ name { name
, sourceType , sourceType
, description ? "Enable ${name} source, for null-ls." , description ? "Enable ${name} source, for null-ls."
, packages ? [ ] , package ? null
, extraPackages ? [ ]
, ... , ...
}: }:
# returns a module # returns a module
@ -13,6 +14,14 @@
let let
helpers = import ../helpers.nix args; helpers = import ../helpers.nix args;
cfg = config.plugins.null-ls.sources.${sourceType}.${name}; 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 in
{ {
options.plugins.null-ls.sources.${sourceType}.${name} = { options.plugins.null-ls.sources.${sourceType}.${name} = {
@ -28,10 +37,11 @@
# '\'{ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }'\' # '\'{ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }'\'
# ''; # '';
}; };
}; } // packageOption;
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPackages = packages; # Does this evaluate package?
extraPackages = packages ++ optional (package != null) cfg.package;
# Add source to list of sources # Add source to list of sources
plugins.null-ls.sourcesItems = plugins.null-ls.sourcesItems =

View file

@ -8,36 +8,36 @@ let
completion = { }; completion = { };
diagnostics = { diagnostics = {
flake8 = { flake8 = {
packages = [ pkgs.python3Packages.flake8 ]; package = pkgs.python3Packages.flake8;
}; };
shellcheck = { shellcheck = {
packages = [ pkgs.shellcheck ]; package = pkgs.shellcheck;
}; };
}; };
formatting = { formatting = {
phpcbf = { phpcbf = {
packages = [ pkgs.phpPackages.phpcbf ]; package = pkgs.phpPackages.phpcbf;
}; };
alejandra = { alejandra = {
packages = [ pkgs.alejandra ]; package = pkgs.alejandra;
}; };
nixfmt = { nixfmt = {
packages = [ pkgs.nixfmt ]; package = pkgs.nixfmt;
}; };
prettier = { prettier = {
packages = [ pkgs.nodePackages.prettier ]; package = pkgs.nodePackages.prettier;
}; };
black = { black = {
packages = [ pkgs.python3Packages.black ]; package = pkgs.python3Packages.black;
}; };
beautysh = { beautysh = {
packages = [ inputs.beautysh.packages.${pkgs.system}.beautysh-python38 ]; package = inputs.beautysh.packages.${pkgs.system}.beautysh-python38;
}; };
fourmolu = { fourmolu = {
packages = [ pkgs.haskellPackages.fourmolu ]; package = pkgs.haskellPackages.fourmolu;
}; };
fnlfmt = { fnlfmt = {
packages = [ pkgs.fnlfmt ]; package = pkgs.fnlfmt;
}; };
}; };
}; };

View file

@ -8,6 +8,13 @@ in
options = { options = {
plugins.lsp-lines = { plugins.lsp-lines = {
enable = mkEnableOption "lsp_lines.nvim"; 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 { currentLine = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
@ -27,7 +34,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.lsp_lines-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
do do

View file

@ -9,6 +9,12 @@ in
plugins.lspsaga = { plugins.lspsaga = {
enable = mkEnableOption "Enable lspsava.nvim"; enable = mkEnableOption "Enable lspsava.nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lspsaga-nvim;
description = "Plugin to use for lspsaga.nvim";
};
signs = { signs = {
use = mkOption { use = mkOption {
default = true; default = true;
@ -195,7 +201,7 @@ in
in notEmpty keys; in notEmpty keys;
}; };
in mkIf cfg.enable { in mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.lspsaga-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
local saga = require 'lspsaga' local saga = require 'lspsaga'

View file

@ -9,6 +9,12 @@ with lib;
options.plugins.trouble = { options.plugins.trouble = {
enable = mkEnableOption "trouble.nvim"; 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"; 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"; 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"; 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 { config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
trouble-nvim cfg.package
nvim-web-devicons nvim-web-devicons
]; ];
}; };

View file

@ -11,6 +11,7 @@ in
package = mkOption { package = mkOption {
default = pkgs.vimPlugins.luasnip; default = pkgs.vimPlugins.luasnip;
type = types.package; type = types.package;
description = "Plugin to use for luasnip";
}; };
fromVscode = mkOption { fromVscode = mkOption {

View file

@ -16,6 +16,12 @@ in
plugins.airline = { plugins.airline = {
enable = mkEnableOption "Enable airline"; enable = mkEnableOption "Enable airline";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-airline;
description = "Plguin to use for airline";
};
extensions = mkOption { extensions = mkOption {
default = null; default = null;
type = with types; nullOr attrs; type = with types; nullOr attrs;
@ -63,7 +69,7 @@ in
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
vim-airline cfg.package
] ++ optional (!isNull cfg.theme) vim-airline-themes; ] ++ optional (!isNull cfg.theme) vim-airline-themes;
globals = { globals = {
airline.extensions = cfg.extensions; airline.extensions = cfg.extensions;

View file

@ -9,6 +9,12 @@ in
plugins.lightline = { plugins.lightline = {
enable = mkEnableOption "Enable lightline"; enable = mkEnableOption "Enable lightline";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lightline-vim;
description = "Plugin to use for lightline";
};
colorscheme = mkOption { colorscheme = mkOption {
type = with types; nullOr str; type = with types; nullOr str;
default = config.colorscheme; default = config.colorscheme;
@ -84,7 +90,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.lightline-vim ]; extraPlugins = [ cfg.package ];
globals.lightline = mkIf (configAttrs != { }) configAttrs; globals.lightline = mkIf (configAttrs != { }) configAttrs;
}; };
} }

View file

@ -58,6 +58,12 @@ in
plugins.lualine = { plugins.lualine = {
enable = mkEnableOption "Enable lualine"; enable = mkEnableOption "Enable lualine";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lualine-nvim;
description = "Plugin to use for lualine";
};
theme = mkOption { theme = mkOption {
default = config.colorscheme; default = config.colorscheme;
type = types.nullOr types.str; type = types.nullOr types.str;
@ -144,7 +150,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.lualine-nvim ]; extraPlugins = [ cfg.package ];
extraPackages = [ pkgs.git ]; extraPackages = [ pkgs.git ];
extraConfigLua = extraConfigLua =
''require("lualine").setup(${helpers.toLuaObject setupOptions})''; ''require("lualine").setup(${helpers.toLuaObject setupOptions})'';

View file

@ -18,6 +18,12 @@ in
options.plugins.telescope = { options.plugins.telescope = {
enable = mkEnableOption "Enable telescope.nvim"; enable = mkEnableOption "Enable telescope.nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.telescope-nvim;
description = "Plugin to use for telescope.nvim";
};
highlightTheme = mkOption { highlightTheme = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
description = "The colorscheme to use for syntax highlighting"; description = "The colorscheme to use for syntax highlighting";
@ -53,7 +59,7 @@ in
extraPackages = [ pkgs.bat ]; extraPackages = [ pkgs.bat ];
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
telescope-nvim cfg.package
plenary-nvim plenary-nvim
popup-nvim popup-nvim
]; ];

View file

@ -7,6 +7,12 @@ in
options.plugins.telescope.extensions.frecency = { options.plugins.telescope.extensions.frecency = {
enable = mkEnableOption "Enable 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 { dbRoot = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
description = "Path to parent directory of custom database location. Defaults to $XDG_DATA_HOME/nvim"; description = "Path to parent directory of custom database location. Defaults to $XDG_DATA_HOME/nvim";
@ -57,7 +63,7 @@ in
in mkIf cfg.enable { in mkIf cfg.enable {
extraPackages = [ pkgs.sqlite ]; extraPackages = [ pkgs.sqlite ];
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
telescope-frecency-nvim cfg.package
sqlite-lua sqlite-lua
]; ];

View file

@ -7,6 +7,12 @@ in
options.plugins.telescope.extensions.fzf-native = { options.plugins.telescope.extensions.fzf-native = {
enable = mkEnableOption "Enable 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 { fuzzy = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
description = "Whether to fuzzy search. False will do exact matching"; description = "Whether to fuzzy search. False will do exact matching";
@ -36,7 +42,7 @@ in
case_mode = cfg.caseMode; case_mode = cfg.caseMode;
}; };
in mkIf cfg.enable { in mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.telescope-fzf-native-nvim ]; extraPlugins = [ cfg.package ];
plugins.telescope.enabledExtensions = [ "fzf" ]; plugins.telescope.enabledExtensions = [ "fzf" ];
plugins.telescope.extensionConfig."fzf" = configuration; plugins.telescope.extensionConfig."fzf" = configuration;

View file

@ -7,6 +7,12 @@ in
options.plugins.telescope.extensions.media_files = { options.plugins.telescope.extensions.media_files = {
enable = mkEnableOption "Enable media_files extension for telescope"; 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 { filetypes = mkOption {
default = null; default = null;
type = with types; nullOr (listOf str); type = with types; nullOr (listOf str);
@ -25,7 +31,7 @@ in
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
popup-nvim popup-nvim
plenary-nvim plenary-nvim
telescope-media-files-nvim cfg.package
]; ];
extraPackages = with pkgs; [ extraPackages = with pkgs; [

View file

@ -8,6 +8,13 @@ in
options = { options = {
plugins.comment-nvim = { plugins.comment-nvim = {
enable = mkEnableOption "Enable 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 { padding = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
description = "Add a space b/w comment and the line"; description = "Add a space b/w comment and the line";
@ -97,7 +104,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.comment-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = extraConfigLua =
''require("Comment").setup${helpers.toLuaObject setupOptions}''; ''require("Comment").setup${helpers.toLuaObject setupOptions}'';
}; };

View file

@ -9,10 +9,16 @@ in
options = { options = {
plugins.commentary = { plugins.commentary = {
enable = mkEnableOption "Enable 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 { config = mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.vim-commentary ]; extraPlugins = [ cfg.package ];
}; };
} }

View file

@ -10,6 +10,12 @@ in
plugins.dashboard = { plugins.dashboard = {
enable = mkEnableOption "Enable dashboard"; enable = mkEnableOption "Enable dashboard";
package = {
type = types.package;
default = pkgs.vimPlugins.dashboard-nvim;
description = "Plugin to use for dashboard-nvim";
};
header = mkOption { header = mkOption {
description = "Header text"; description = "Header text";
type = types.nullOr (types.listOf types.str); type = types.nullOr (types.listOf types.str);
@ -126,7 +132,7 @@ in
filteredOptions = filterAttrs (_: v: !isNull v) options; filteredOptions = filterAttrs (_: v: !isNull v) options;
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.dashboard-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
local dashboard = require("dashboard") local dashboard = require("dashboard")

View file

@ -8,11 +8,17 @@ in
options = { options = {
plugins.easyescape = { plugins.easyescape = {
enable = mkEnableOption "Enable 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 { config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = [
vim-easyescape cfg.package
]; ];
}; };
} }

View file

@ -10,7 +10,7 @@ in with helpers;
mkPlugin attrs { mkPlugin attrs {
name = "emmet"; name = "emmet";
description = "Enable emmet"; description = "Enable emmet";
extraPlugins = [ pkgs.vimPlugins.emmet-vim ]; package = pkgs.vimPlugins.emmet-vim;
options = { options = {
mode = mkDefaultOpt { mode = mkDefaultOpt {

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs { mkPlugin attrs {
name = "endwise"; name = "endwise";
description = "Enable vim-endwise"; description = "Enable vim-endwise";
extraPlugins = [ pkgs.vimPlugins.vim-endwise ]; package = pkgs.vimPlugins.vim-endwise;
# Yes it's really not configurable # Yes it's really not configurable
options = {}; options = {};

View file

@ -8,6 +8,13 @@ in
options = { options = {
plugins.floaterm = { plugins.floaterm = {
enable = mkEnableOption "Enable floaterm"; enable = mkEnableOption "Enable floaterm";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-floaterm;
description = "Plugin to use for floatterm";
};
shell = mkOption { shell = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
@ -64,8 +71,8 @@ in
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = [
vim-floaterm cfg.package
]; ];
globals = { globals = {
floaterm_shell = mkIf (!isNull cfg.shell) cfg.shell; floaterm_shell = mkIf (!isNull cfg.shell) cfg.shell;

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs { mkPlugin attrs {
name = "goyo"; name = "goyo";
description = "Enable goyo.vim"; description = "Enable goyo.vim";
extraPlugins = [ pkgs.vimPlugins.goyo-vim ]; package = pkgs.vimPlugins.goyo-vim;
options = { options = {
width = mkDefaultOpt { width = mkDefaultOpt {

View file

@ -8,11 +8,17 @@ in
options = { options = {
plugins.intellitab = { plugins.intellitab = {
enable = mkEnableOption "intellitab.nvim"; enable = mkEnableOption "intellitab.nvim";
package = mkOption {
type = types.package;
default = defs.intellitab-nvim;
description = "Plugin to use for intellitab.nvim";
};
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPlugins = [ defs.intellitab-nvim ]; extraPlugins = [ cfg.package ];
maps.insert."<Tab>" = "<CMD>lua require([[intellitab]]).indent()<CR>"; maps.insert."<Tab>" = "<CMD>lua require([[intellitab]]).indent()<CR>";
plugins.treesitter = { plugins.treesitter = {

View file

@ -10,6 +10,12 @@ in
options.plugins.mark-radar = { options.plugins.mark-radar = {
enable = mkEnableOption "Enable 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 { highlight_background = mkOption {
type = with types; nullOr bool; type = with types; nullOr bool;
default = null; default = null;
@ -40,7 +46,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ defs.mark-radar ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
require("mark-radar").setup(${opts}) require("mark-radar").setup(${opts})

View file

@ -12,6 +12,12 @@ in
options.plugins.notify = { options.plugins.notify = {
enable = mkEnableOption "Enable notify"; enable = mkEnableOption "Enable notify";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.nvim-notify;
description = "Plugin to use for notify";
};
stages = mkOption { stages = mkOption {
type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]); type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]);
description = "Animation style"; description = "Animation style";
@ -64,7 +70,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.nvim-notify ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
vim.notify = require('notify'); vim.notify = require('notify');
require('notify').setup(${helpers.toLuaObject setupOptions}) require('notify').setup(${helpers.toLuaObject setupOptions})

View file

@ -8,6 +8,12 @@ in
options.plugins.nvim-autopairs = { options.plugins.nvim-autopairs = {
enable = mkEnableOption "Enable 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 { pairs = mkOption {
type = types.nullOr (types.attrsOf types.str); type = types.nullOr (types.attrsOf types.str);
default = null; default = null;
@ -50,7 +56,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.nvim-autopairs ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
require('nvim-autopairs').setup(${helpers.toLuaObject options}) require('nvim-autopairs').setup(${helpers.toLuaObject options})

View file

@ -8,6 +8,12 @@ in
options.plugins.nvim-tree = { options.plugins.nvim-tree = {
enable = mkEnableOption "Enable 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 { disableNetrw = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = null; default = null;
@ -257,7 +263,7 @@ in
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [ extraPlugins = with pkgs.vimPlugins; [
nvim-tree-lua cfg.package
nvim-web-devicons nvim-web-devicons
]; ];

View file

@ -8,6 +8,12 @@ in
options.plugins.project-nvim = helpers.extraOptionsOptions // { options.plugins.project-nvim = helpers.extraOptionsOptions // {
enable = mkEnableOption "Enable project.nvim"; enable = mkEnableOption "Enable project.nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.project-nvim;
description = "Plugin to use for project-nvim";
};
manualMode = mkOption { manualMode = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = null; default = null;
@ -70,7 +76,7 @@ in
} // cfg.extraOptions; } // cfg.extraOptions;
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.project-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = '' extraConfigLua = ''
require('project_nvim').setup(${helpers.toLuaObject options}) require('project_nvim').setup(${helpers.toLuaObject options})

View file

@ -8,6 +8,12 @@ in
options.plugins.specs = { options.plugins.specs = {
enable = mkEnableOption "Enable specs-nvim"; 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 { show_jumps = mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
@ -137,7 +143,7 @@ in
}; };
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.specs-nvim ]; extraPlugins = [ cfg.package ];
highlight.SpecsPopColor.bg = mkIf (!isNull cfg.color) cfg.color; highlight.SpecsPopColor.bg = mkIf (!isNull cfg.color) cfg.color;

View file

@ -5,7 +5,7 @@ in with lib; with helpers;
mkPlugin args { mkPlugin args {
name = "startify"; name = "startify";
description = "Enable startify"; description = "Enable startify";
extraPlugins = [ pkgs.vimPlugins.vim-startify ]; package = pkgs.vimPlugins.vim-startify;
options = { options = {
sessionDir = mkDefaultOpt { sessionDir = mkDefaultOpt {

View file

@ -5,7 +5,7 @@ in with helpers; with lib;
mkPlugin attrs { mkPlugin attrs {
name = "surround"; name = "surround";
description = "Enable surround.vim"; description = "Enable surround.vim";
extraPlugins = [ pkgs.vimPlugins.surround ]; package = pkgs.vimPlugins.surround;
options = {}; options = {};
} }

View file

@ -9,6 +9,12 @@ in
plugins.undotree = { plugins.undotree = {
enable = mkEnableOption "Enable undotree"; enable = mkEnableOption "Enable undotree";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.undotree;
description = "Plugin to use for undotree";
};
windowLayout = mkOption { windowLayout = mkOption {
type = types.nullOr types.int; type = types.nullOr types.int;
default = null; default = null;
@ -108,7 +114,7 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.undotree ]; extraPlugins = [ cfg.package ];
globals = { globals = {
undotree_WindowLayout = mkIf (cfg.windowLayout != null) cfg.windowLayout; undotree_WindowLayout = mkIf (cfg.windowLayout != null) cfg.windowLayout;