From 6a15c2ffc50ca7998df2fd6b86c3c9f298e9137a Mon Sep 17 00:00:00 2001 From: Jakob Beckmann Date: Sun, 22 Jun 2025 08:59:02 +0200 Subject: [PATCH] colorschemes/gruvbox-material: init Signed-off-by: Jakob Beckmann --- plugins/colorschemes/gruvbox-material.nix | 42 ++++++++++++ plugins/default.nix | 1 + .../plugins/colorschemes/gruvbox-material.nix | 66 +++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 plugins/colorschemes/gruvbox-material.nix create mode 100644 tests/test-sources/plugins/colorschemes/gruvbox-material.nix diff --git a/plugins/colorschemes/gruvbox-material.nix b/plugins/colorschemes/gruvbox-material.nix new file mode 100644 index 00000000..6073689c --- /dev/null +++ b/plugins/colorschemes/gruvbox-material.nix @@ -0,0 +1,42 @@ +{ + lib, + config, + ... +}: +lib.nixvim.plugins.mkNeovimPlugin { + name = "gruvbox-material"; + isColorscheme = true; + packPathName = "gruvbox-material.nvim"; + package = "gruvbox-material-nvim"; + + maintainers = [ lib.maintainers.f4z3r ]; + + settingsExample = { + italics = true; + contrast = "medium"; + comments = { + italics = true; + }; + background = { + transparent = false; + }; + float = { + force_background = false; + }; + signs = { + highlight = true; + }; + customize = lib.nixvim.nestedLiteralLua '' + function(g, o) + local colors = require("gruvbox-material.colors").get(vim.o.background, "medium") + if g == "CursorLineNr" then + o.link = nil -- wipe a potential link, which would take precedence over other + -- attributes + o.fg = colors.orange -- or use any color in "#rrggbb" hex format + o.bold = true + end + return o + end + ''; + }; +} diff --git a/plugins/default.nix b/plugins/default.nix index 8e26df39..f9eaf515 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -12,6 +12,7 @@ ./colorschemes/everforest.nix ./colorschemes/github-theme.nix ./colorschemes/gruvbox.nix + ./colorschemes/gruvbox-material.nix ./colorschemes/kanagawa.nix ./colorschemes/kanagawa-paper.nix ./colorschemes/melange.nix diff --git a/tests/test-sources/plugins/colorschemes/gruvbox-material.nix b/tests/test-sources/plugins/colorschemes/gruvbox-material.nix new file mode 100644 index 00000000..ff168670 --- /dev/null +++ b/tests/test-sources/plugins/colorschemes/gruvbox-material.nix @@ -0,0 +1,66 @@ +{ lib, ... }: +{ + empty = { + colorschemes.gruvbox-material.enable = true; + }; + + defaults = { + colorschemes.gruvbox-material = { + enable = true; + + settings = { + italics = true; + contrast = "medium"; + comments = { + italics = true; + }; + background = { + transparent = false; + }; + float = { + force_background = false; + background_color = null; + }; + signs = { + highlight = true; + }; + customize = null; + }; + }; + }; + + example = { + colorschemes.gruvbox-material = { + enable = true; + + settings = { + italics = true; + contrast = "medium"; + comments = { + italics = true; + }; + background = { + transparent = false; + }; + float = { + force_background = false; + }; + signs = { + highlight = true; + }; + customize = lib.nixvim.mkRaw '' + function(g, o) + local colors = require("gruvbox-material.colors").get(vim.o.background, "medium") + if g == "CursorLineNr" then + o.link = nil -- wipe a potential link, which would take precedence over other + -- attributes + o.fg = colors.orange -- or use any color in "#rrggbb" hex format + o.bold = true + end + return o + end + ''; + }; + }; + }; +}