plugins/rose-pine: add colorscheme + test (#435)

* plugins/rose-pine: add colorscheme & test

* Fixed typo in test

* Fix invalid option in test

* Use inherit instead of cfg.groups in plugins/rose-pine.nix

* plugins/rosepine: improved formatting
This commit is contained in:
Wolbyte 2023-06-19 09:15:48 +03:30 committed by GitHub
parent f5825552e4
commit 136f059405
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 106 additions and 0 deletions

View file

@ -0,0 +1,54 @@
{
pkgs,
config,
lib,
...
} @ args:
with lib; let
cfg = config.colorschemes.rose-pine;
helpers = import ../helpers.nix args;
in {
options = {
colorschemes.rose-pine = {
enable = mkEnableOption "rose-pine";
package = helpers.mkPackageOption "rose-pine" pkgs.vimPlugins.rose-pine;
style = helpers.defaultNullOpts.mkEnumFirstDefault ["main" "moon" "dawn"] "Theme style";
boldVerticalSplit = helpers.defaultNullOpts.mkBool false "Bolds vertical splits";
dimInactive = helpers.defaultNullOpts.mkBool false "Dims inactive windows";
disableItalics = helpers.defaultNullOpts.mkBool false "Disables italics";
groups = helpers.mkNullOrOption types.attrs "rose-pine highlight groups";
highlightGroups = helpers.mkNullOrOption types.attrs "Custom highlight groups";
transparentBackground = helpers.defaultNullOpts.mkBool false "Disable setting background";
transparentFloat = helpers.defaultNullOpts.mkBool false "Disable setting background for floating windows";
};
};
config = mkIf cfg.enable {
colorscheme = "rose-pine";
extraPlugins = [cfg.package];
options = {termguicolors = true;};
extraConfigLuaPre = let
setupOptions = with cfg; {
inherit groups;
dark_variant = style;
bold_vert_split = boldVerticalSplit;
disable_background = transparentBackground;
disable_float_background = transparentFloat;
disable_italics = disableItalics;
dim_nc_background = dimInactive;
highlight_groups = highlightGroups;
};
in ''
require("rose-pine").setup(${helpers.toLuaObject setupOptions})
'';
};
}

View file

@ -11,6 +11,7 @@
./colorschemes/poimandres.nix
./colorschemes/tokyonight.nix
./colorschemes/catppuccin.nix
./colorschemes/rose-pine.nix
./completion/coq.nix
./completion/coq-thirdparty.nix

View file

@ -0,0 +1,51 @@
{
empty = {
colorschemes.rose-pine.enable = true;
};
defaults = {
colorschemes.rose-pine = {
enable = true;
style = "main";
boldVerticalSplit = false;
dimInactive = false;
disableItalics = false;
groups = {
background = "base";
background_nc = "_experimental_nc";
panel = "surface";
panel_nc = "base";
border = "highlight_med";
comment = "muted";
link = "iris";
punctuation = "subtle";
error = "love";
hint = "iris";
info = "foam";
warn = "gold";
headings = {
h1 = "iris";
h2 = "foam";
h3 = "rose";
h4 = "gold";
h5 = "pine";
h6 = "foam";
};
};
highlightGroups = {
ColorColumn = {bg = "rose";};
CursorLine = {
bg = "foam";
blend = 10;
};
StatusLine = {
fg = "love";
bg = "love";
blend = 10;
};
};
transparentBackground = false;
transparentFloat = false;
};
};
}