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

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