nix-community.nixvim/plugins/colorschemes/ayu.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Nix
Raw Normal View History

2023-08-10 12:08:41 +02:00
{
lib,
...
}:
let
inherit (lib.nixvim) defaultNullOpts toLuaObject;
in
2024-12-22 09:58:27 +00:00
lib.nixvim.plugins.mkNeovimPlugin {
name = "ayu";
isColorscheme = true;
packPathName = "neovim-ayu";
package = "neovim-ayu";
# The colorscheme option is set by the `setup` function.
colorscheme = null;
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
deprecateExtraOptions = true;
optionsRenamedToSettings = [
"mirage"
"overrides"
];
2023-08-10 12:08:41 +02:00
settingsOptions = {
mirage = defaultNullOpts.mkBool false ''
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) { } ''
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
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
extraConfig = cfg: {
colorschemes.ayu.luaConfig.content = ''
local ayu = require("ayu")
ayu.setup(${toLuaObject cfg.settings})
ayu.colorscheme()
2023-08-10 12:08:41 +02:00
'';
};
}