colorschemes/ayu: switch to mkNeovimPlugin

This commit is contained in:
Gaetan Lepage 2024-02-16 18:44:10 +01:00 committed by Gaétan Lepage
parent efdd9f2688
commit 9ec2de03af

View file

@ -5,17 +5,23 @@
pkgs, pkgs,
... ...
}: }:
with lib; let with lib;
cfg = config.colorschemes.ayu; helpers.neovim-plugin.mkNeovimPlugin config {
in { name = "ayu";
options = { namespace = "colorschemes";
colorschemes.ayu = originalName = "neovim-ayu";
helpers.neovim-plugin.extraOptionsOptions defaultPackage = pkgs.vimPlugins.neovim-ayu;
// { callSetup = false;
enable = mkEnableOption "ayu";
package = helpers.mkPackageOption "ayu" pkgs.vimPlugins.neovim-ayu; maintainers = [maintainers.GaetanLepage];
deprecateExtraConfig = true;
optionsRenamedToSettings = [
"mirage"
"overrides"
];
settingsOptions = {
mirage = helpers.defaultNullOpts.mkBool false '' mirage = helpers.defaultNullOpts.mkBool false ''
Set to `true` to use `mirage` variant instead of `dark` for dark background. Set to `true` to use `mirage` variant instead of `dark` for dark background.
''; '';
@ -34,22 +40,12 @@ in {
`background`. `background`.
''; '';
}; };
};
config = let
setupOptions = with cfg;
{
inherit overrides;
}
// cfg.extraOptions;
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraConfig = cfg: {
extraConfigLuaPre = '' extraConfigLuaPre = ''
local ayu = require("ayu") local ayu = require("ayu")
ayu.setup(${helpers.toLuaObject setupOptions}) ayu.setup(${helpers.toLuaObject cfg.settings})
ayu.colorscheme() ayu.colorscheme()
''; '';
}; };
} }