Skip to content

Commit

Permalink
colorschemes/gruvbox: switch to mkNeovimPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Feb 14, 2024
1 parent f3e2fba commit e7700ce
Showing 1 changed file with 55 additions and 70 deletions.
125 changes: 55 additions & 70 deletions plugins/colorschemes/gruvbox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,63 @@
config,
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.gruvbox;
in {
meta.maintainers = [maintainers.GaetanLepage];

# Introduced January 31 2024
# TODO remove in early March 2024.
}: {
imports =
map
(
optionName:
mkRemovedOptionModule
["colorschemes" "gruvbox" optionName]
"Please use `colorschemes.gruvbox.settings.${helpers.toSnakeCase optionName}` instead."
)
[
"italics"
"bold"
"underline"
"undercurl"
"contrastDark"
"contrastLight"
"highlightSearchCursor"
"numberColumn"
"signColumn"
"colorColumn"
"vertSplitColor"
"italicizeComments"
"italicizeStrings"
"invertSelection"
"invertSigns"
"invertIndentGuides"
"invertTabline"
"improvedStrings"
"improvedWarnings"
"transparentBg"
"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";
};
};
};
};
(
helpers.neovim-plugin.mkNeovimPlugin config {
name = "gruvbox";
namespace = "colorschemes";
originalName = "gruvbox.nvim";
defaultPackage = pkgs.vimPlugins.gruvbox-nvim;

config = mkIf cfg.enable {
colorscheme = "gruvbox";
extraPlugins = [cfg.package];
settingsExample = {
terminal_colors = true;
palette_overrides = {
dark1 = "#323232";
dark2 = "#383330";
dark3 = "#323232";
bright_blue = "#5476b2";
bright_purple = "#fb4934";
};
};

extraConfigLua = ''
require('gruvbox').setup(${helpers.toLuaObject cfg.settings})
'';
};
maintainers = [lib.maintainers.GaetanLepage];
}
)
]
# Introduced January 31 2024
# TODO remove in early March 2024.
++ (
map
(
optionName:
lib.mkRemovedOptionModule
["colorschemes" "gruvbox" optionName]
"Please use `colorschemes.gruvbox.settings.${helpers.toSnakeCase optionName}` instead."
)
[
"italics"
"bold"
"underline"
"undercurl"
"contrastDark"
"contrastLight"
"highlightSearchCursor"
"numberColumn"
"signColumn"
"colorColumn"
"vertSplitColor"
"italicizeComments"
"italicizeStrings"
"invertSelection"
"invertSigns"
"invertIndentGuides"
"invertTabline"
"improvedStrings"
"improvedWarnings"
"transparentBg"
"trueColor"
]
);
}

0 comments on commit e7700ce

Please sign in to comment.