colorschemes/one: switch to mkVimPlugin

This commit is contained in:
Gaetan Lepage 2024-03-27 10:52:44 +01:00 committed by Gaétan Lepage
parent b8b0c1d58f
commit a1d97bf199
2 changed files with 32 additions and 14 deletions

View file

@ -5,23 +5,26 @@
pkgs,
...
}:
with lib; let
cfg = config.colorschemes.one;
in {
options = {
colorschemes.one = {
enable = mkEnableOption "vim-one";
helpers.vim-plugin.mkVimPlugin config {
name = "one";
isColorscheme = true;
originalName = "vim-one";
defaultPackage = pkgs.vimPlugins.vim-one;
globalPrefix = "one_";
package = helpers.mkPackageOption "one" pkgs.vimPlugins.vim-one;
};
maintainers = [lib.maintainers.GaetanLepage];
settingsOptions = {
allow_italics = helpers.defaultNullOpts.mkBool false ''
Whether to enable _italic_ (as long as your terminal supports it).
'';
};
config = mkIf cfg.enable {
colorscheme = "one";
extraPlugins = [cfg.package];
settingsExample = {
allow_italics = true;
};
options = {
termguicolors = true;
};
extraConfig = cfg: {
options.termguicolors = lib.mkDefault true;
};
}

View file

@ -0,0 +1,15 @@
{
empty = {
colorschemes.one.enable = true;
};
defaults = {
colorschemes.one = {
enable = true;
settings = {
allow_italics = false;
};
};
};
}