nix-community.nixvim/plugins/colorschemes/onedark.nix
Quentin Boyer d2f9e011d9 lib/neovim-plugin: Add lua configuration scoped to the plugin
This commit adds a `plugins.<name>.luaConfig` section controlling the
plugin specific configuration.

The section contains the internal `init` option, containing the plugin's
initialization code.

It also contains the public `pre` and `post` options, that allow to add
code before & after the `init` section

Finally, it contains the `final` option, being the concatenation of the
three previous options.
2024-09-22 16:15:27 +00:00

43 lines
890 B
Nix

{
lib,
...
}:
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "onedark";
isColorscheme = true;
originalName = "onedark.nvim";
package = "onedark-nvim";
maintainers = [ lib.maintainers.GaetanLepage ];
settingsExample = {
colors = {
bright_orange = "#ff8800";
green = "#00ffaa";
};
highlights = {
"@keyword".fg = "$green";
"@string" = {
fg = "$bright_orange";
bg = "#00ff00";
fmt = "bold";
};
"@function" = {
fg = "#0000ff";
sp = "$cyan";
fmt = "underline,italic";
};
"@function.builtin".fg = "#0059ff";
};
};
callSetup = false;
colorscheme = null;
extraConfig = cfg: {
colorschemes.onedark.luaConfig.content = ''
_onedark = require('onedark')
_onedark.setup(${lib.nixvim.toLuaObject cfg.settings})
_onedark.load()
'';
};
}