2023-08-10 12:08:41 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-06 15:04:08 +01:00
|
|
|
}:
|
2024-08-22 09:24:17 -05:00
|
|
|
let
|
|
|
|
inherit (lib.nixvim) defaultNullOpts toLuaObject;
|
|
|
|
in
|
2024-12-22 09:58:27 +00:00
|
|
|
lib.nixvim.plugins.mkNeovimPlugin {
|
2024-02-16 18:44:10 +01:00
|
|
|
name = "ayu";
|
2024-03-12 22:30:45 +01:00
|
|
|
isColorscheme = true;
|
2024-12-13 08:27:14 -06:00
|
|
|
packPathName = "neovim-ayu";
|
2024-09-02 14:05:11 +01:00
|
|
|
package = "neovim-ayu";
|
2024-03-12 22:30:45 +01:00
|
|
|
# The colorscheme option is set by the `setup` function.
|
|
|
|
colorscheme = null;
|
2024-02-16 18:44:10 +01:00
|
|
|
callSetup = false;
|
2023-08-10 12:08:41 +02:00
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
2023-08-10 12:08:41 +02:00
|
|
|
|
2024-02-19 00:24:10 +01:00
|
|
|
deprecateExtraOptions = true;
|
2024-02-16 18:44:10 +01:00
|
|
|
optionsRenamedToSettings = [
|
|
|
|
"mirage"
|
|
|
|
"overrides"
|
|
|
|
];
|
2023-08-10 12:08:41 +02:00
|
|
|
|
2024-02-16 18:44:10 +01:00
|
|
|
settingsOptions = {
|
2024-08-22 09:24:17 -05:00
|
|
|
mirage = defaultNullOpts.mkBool false ''
|
2024-02-16 18:44:10 +01:00
|
|
|
Set to `true` to use `mirage` variant instead of `dark` for dark background.
|
|
|
|
'';
|
2023-08-10 12:08:41 +02:00
|
|
|
|
2024-08-22 10:03:02 -05:00
|
|
|
overrides = defaultNullOpts.mkStrLuaOr (with lib.types; attrsOf highlight) { } ''
|
2024-02-16 18:44:10 +01:00
|
|
|
A dictionary of group names, each associated with a dictionary of parameters
|
|
|
|
(`bg`, `fg`, `sp` and `style`) and colors in hex.
|
2023-08-10 12:08:41 +02:00
|
|
|
|
2024-02-16 18:44:10 +01:00
|
|
|
Alternatively, `overrides` can be a function that returns a dictionary of the same
|
|
|
|
format.
|
|
|
|
You can use the function to override based on a dynamic condition, such as the value of
|
|
|
|
`background`.
|
|
|
|
'';
|
|
|
|
};
|
2023-08-10 12:08:41 +02:00
|
|
|
|
2024-02-16 18:44:10 +01:00
|
|
|
extraConfig = cfg: {
|
2024-08-19 23:31:57 +02:00
|
|
|
colorschemes.ayu.luaConfig.content = ''
|
2023-10-22 12:48:48 +00:00
|
|
|
local ayu = require("ayu")
|
2024-08-22 09:24:17 -05:00
|
|
|
ayu.setup(${toLuaObject cfg.settings})
|
2023-10-22 12:48:48 +00:00
|
|
|
ayu.colorscheme()
|
2023-08-10 12:08:41 +02:00
|
|
|
'';
|
|
|
|
};
|
2024-02-16 18:44:10 +01:00
|
|
|
}
|