plugins/{telescope,bufferline}: make use of helpers.extraOptionsOptions (#212)

This commit is contained in:
Gaétan Lepage 2023-03-01 22:57:19 +01:00 committed by GitHub
parent 73bdf8a96f
commit e439cb79df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 255 additions and 262 deletions

View file

@ -35,7 +35,9 @@ in {
]; ];
options = { options = {
plugins.bufferline = { plugins.bufferline =
helpers.extraOptionsOptions
// {
enable = mkEnableOption "bufferline"; enable = mkEnableOption "bufferline";
package = helpers.mkPackageOption "bufferline" pkgs.vimPlugins.bufferline-nvim; package = helpers.mkPackageOption "bufferline" pkgs.vimPlugins.bufferline-nvim;
numbers = mkOption { numbers = mkOption {
@ -64,7 +66,8 @@ in {
default = null; default = null;
}; };
# is deprecated, but might still work # is deprecated, but might still work
indicatorIcon = mkOption { indicatorIcon =
mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
description = "The Icon shown as a indicator for buffer. Changing it is NOT recommended, description = "The Icon shown as a indicator for buffer. Changing it is NOT recommended,
this is intended to be an escape hatch for people who cannot bear it for whatever reason."; this is intended to be an escape hatch for people who cannot bear it for whatever reason.";
@ -246,12 +249,6 @@ in {
}; };
})); }));
}; };
extraOptions = mkOption {
type = types.attrs;
default = {};
description = "Extra options, will override others if defined";
};
}; };
}; };

View file

@ -18,7 +18,9 @@ in {
# TODO:add support for aditional filetypes. This requires autocommands! # TODO:add support for aditional filetypes. This requires autocommands!
options.plugins.telescope = { options.plugins.telescope =
helpers.extraOptionsOptions
// {
enable = mkEnableOption "telescope.nvim"; enable = mkEnableOption "telescope.nvim";
package = helpers.mkPackageOption "telescope.nvim" pkgs.vimPlugins.telescope-nvim; package = helpers.mkPackageOption "telescope.nvim" pkgs.vimPlugins.telescope-nvim;
@ -62,12 +64,6 @@ in {
default = null; default = null;
description = "Telescope default configuration"; description = "Telescope default configuration";
}; };
extraOptions = mkOption {
type = types.attrs;
default = {};
description = "An attribute set, that lets you set extra options or override options set by nixvim";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {