mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-18 09:44:37 +02:00
colorschemes/ayu: switch to mkNeovimPlugin
This commit is contained in:
parent
efdd9f2688
commit
9ec2de03af
1 changed files with 35 additions and 39 deletions
|
@ -5,17 +5,23 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.colorschemes.ayu;
|
||||
in {
|
||||
options = {
|
||||
colorschemes.ayu =
|
||||
helpers.neovim-plugin.extraOptionsOptions
|
||||
// {
|
||||
enable = mkEnableOption "ayu";
|
||||
with lib;
|
||||
helpers.neovim-plugin.mkNeovimPlugin config {
|
||||
name = "ayu";
|
||||
namespace = "colorschemes";
|
||||
originalName = "neovim-ayu";
|
||||
defaultPackage = pkgs.vimPlugins.neovim-ayu;
|
||||
callSetup = false;
|
||||
|
||||
package = helpers.mkPackageOption "ayu" pkgs.vimPlugins.neovim-ayu;
|
||||
maintainers = [maintainers.GaetanLepage];
|
||||
|
||||
deprecateExtraConfig = true;
|
||||
optionsRenamedToSettings = [
|
||||
"mirage"
|
||||
"overrides"
|
||||
];
|
||||
|
||||
settingsOptions = {
|
||||
mirage = helpers.defaultNullOpts.mkBool false ''
|
||||
Set to `true` to use `mirage` variant instead of `dark` for dark background.
|
||||
'';
|
||||
|
@ -34,22 +40,12 @@ in {
|
|||
`background`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
setupOptions = with cfg;
|
||||
{
|
||||
inherit overrides;
|
||||
}
|
||||
// cfg.extraOptions;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraConfigLuaPre = ''
|
||||
local ayu = require("ayu")
|
||||
ayu.setup(${helpers.toLuaObject setupOptions})
|
||||
ayu.setup(${helpers.toLuaObject cfg.settings})
|
||||
ayu.colorscheme()
|
||||
'';
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue