Skip to content

Commit

Permalink
bufferline: refactor - added package and extraOptions options. (nix-c…
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexnortung authored Jan 19, 2023
1 parent 11da3bf commit d2f714c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions plugins/bufferlines/bufferline.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ in
options = {
plugins.bufferline = {
enable = mkEnableOption "Enable bufferline";
package = mkOption {
type = types.package;
description = "Plugin to use for bufferline";
default = pkgs.vimPlugins.bufferline-nvim;
};
numbers = mkOption {
type = types.nullOr types.lines;
description = "A lua function customizing the styling of numbers.";
Expand Down Expand Up @@ -109,7 +114,7 @@ in
default = null;
};
diagnosticsIndicator = mkOption {
type = types.nullOr types.lines;
type = types.nullOr helpers.rawType;
default = null;
};
customFilter = mkOption {
Expand Down Expand Up @@ -218,6 +223,12 @@ in
};
}));
};

extraOptions = mkOption {
type = types.attrs;
default = { };
description = "Extra options, will override others if defined";
};
};
};

Expand Down Expand Up @@ -253,7 +264,7 @@ in
enforce_regular_tabs = cfg.enforceRegularTabs;
always_show_bufferline = cfg.alwaysShowBufferline;
sort_by = cfg.sortBy;
};
} // cfg.extraOptions;
highlights = if builtins.isNull cfg.highlights then null else with cfg.highlights; {
fill = fill;
background = background;
Expand Down Expand Up @@ -319,7 +330,7 @@ in
in
mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [
bufferline-nvim
cfg.package
nvim-web-devicons
];
options.termguicolors = true;
Expand Down

0 comments on commit d2f714c

Please sign in to comment.