colorschemes/gruvbox: switch to mkNeovimPlugin

This commit is contained in:
Gaetan Lepage 2024-02-12 00:02:09 +01:00 committed by Gaétan Lepage
parent f3e2fbace2
commit e7700cea5e

View file

@ -4,19 +4,38 @@
config, config,
pkgs, pkgs,
... ...
}: }: {
with lib; let imports =
cfg = config.colorschemes.gruvbox; [
in { (
meta.maintainers = [maintainers.GaetanLepage]; helpers.neovim-plugin.mkNeovimPlugin config {
name = "gruvbox";
namespace = "colorschemes";
originalName = "gruvbox.nvim";
defaultPackage = pkgs.vimPlugins.gruvbox-nvim;
settingsExample = {
terminal_colors = true;
palette_overrides = {
dark1 = "#323232";
dark2 = "#383330";
dark3 = "#323232";
bright_blue = "#5476b2";
bright_purple = "#fb4934";
};
};
maintainers = [lib.maintainers.GaetanLepage];
}
)
]
# Introduced January 31 2024 # Introduced January 31 2024
# TODO remove in early March 2024. # TODO remove in early March 2024.
imports = ++ (
map map
( (
optionName: optionName:
mkRemovedOptionModule lib.mkRemovedOptionModule
["colorschemes" "gruvbox" optionName] ["colorschemes" "gruvbox" optionName]
"Please use `colorschemes.gruvbox.settings.${helpers.toSnakeCase optionName}` instead." "Please use `colorschemes.gruvbox.settings.${helpers.toSnakeCase optionName}` instead."
) )
@ -42,40 +61,6 @@ in {
"improvedWarnings" "improvedWarnings"
"transparentBg" "transparentBg"
"trueColor" "trueColor"
]; ]
);
options.colorschemes.gruvbox = {
enable = mkEnableOption "gruvbox.nvim";
package = helpers.mkPackageOption "gruvbox.nvim" pkgs.vimPlugins.gruvbox-nvim;
settings = mkOption {
type = with types;
submodule {
freeformType = attrs;
options = {};
};
description = "The configuration options for gruvbox.";
default = {};
example = {
terminal_colors = true;
palette_overrides = {
dark1 = "#323232";
dark2 = "#383330";
dark3 = "#323232";
bright_blue = "#5476b2";
bright_purple = "#fb4934";
};
};
};
};
config = mkIf cfg.enable {
colorscheme = "gruvbox";
extraPlugins = [cfg.package];
extraConfigLua = ''
require('gruvbox').setup(${helpers.toLuaObject cfg.settings})
'';
};
} }