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 = {
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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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 = ''

View file

@ -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})

View file

@ -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')

View file

@ -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

View file

@ -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;

View file

@ -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:

View file

@ -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;

View file

@ -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;
};
};

View file

@ -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 {

View file

@ -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 = {};

View file

@ -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;

View file

@ -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;
@ -41,11 +46,12 @@ with lib; {
};
};
config = let
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;

View file

@ -1,20 +1,28 @@
{
pkgs,
config,
lib,
...
{ pkgs
, config
, lib
, ...
}:
with lib; {
options.plugins.treesitter-refactor = let
options.plugins.treesitter-refactor =
let
disable = mkOption {
type = types.listOf types.str;
default = [ ];
description = "List of languages to disable the module on";
};
in {
in
{
enable =
mkEnableOption
"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 =
@ -95,11 +103,13 @@ with lib; {
};
};
config = let
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;
@ -112,9 +122,11 @@ with lib; {
};
navigation = {
inherit (cfg.navigation) enable disable;
keymaps = let
keymaps =
let
cfgK = cfg.navigation.keymaps;
in {
in
{
goto_definition = cfgK.gotoDefinition;
goto_definition_lsp_fallback = cfgK.gotoDefinitionLspFallback;
list_definitions = cfgK.listDefinitons;

View file

@ -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 {

View file

@ -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 = {

View file

@ -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})

View file

@ -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 =

View file

@ -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;
};
};
};

View file

@ -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

View file

@ -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'

View file

@ -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
];
};

View file

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

View file

@ -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;

View file

@ -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;
};
}

View file

@ -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})'';

View file

@ -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
];

View file

@ -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
];

View file

@ -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;

View file

@ -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; [

View file

@ -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}'';
};

View file

@ -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 ];
};
}

View file

@ -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")

View file

@ -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
];
};
}

View file

@ -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 {

View file

@ -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 = {};

View file

@ -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;

View file

@ -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 {

View file

@ -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."<Tab>" = "<CMD>lua require([[intellitab]]).indent()<CR>";
plugins.treesitter = {

View file

@ -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})

View file

@ -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})

View file

@ -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})

View file

@ -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
];

View file

@ -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})

View file

@ -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;

View file

@ -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 {

View file

@ -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 = {};
}

View file

@ -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;