nix-community.nixvim/plugins/colorschemes/rose-pine.nix

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

161 lines
4.1 KiB
Nix
Raw Normal View History

{
lib,
...
}:
let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
in
2024-09-01 12:52:28 +01:00
lib.nixvim.neovim-plugin.mkNeovimPlugin {
name = "rose-pine";
isColorscheme = true;
2024-05-05 19:39:35 +02:00
2024-08-22 10:03:02 -05:00
maintainers = [ lib.maintainers.GaetanLepage ];
2024-05-05 19:39:35 +02:00
# TODO introduced 2024-04-15: remove 2024-06-15
optionsRenamedToSettings = [
"groups"
"highlightGroups"
];
imports =
let
basePluginPath = [
"colorschemes"
"rose-pine"
];
in
[
2024-08-22 10:03:02 -05:00
(lib.mkRenamedOptionModule (basePluginPath ++ [ "style" ]) (
basePluginPath
++ [
"settings"
"dark_variant"
2024-05-05 19:39:35 +02:00
]
))
2024-08-22 10:03:02 -05:00
(lib.mkRenamedOptionModule (basePluginPath ++ [ "dimInactive" ]) (
basePluginPath
2024-05-05 19:39:35 +02:00
++ [
"settings"
"dim_inactive_windows"
2024-05-05 19:39:35 +02:00
]
))
2024-08-22 10:03:02 -05:00
(lib.mkRemovedOptionModule (
basePluginPath ++ [ "disableItalics" ]
) "Use `colorschemes.rose-pine.settings.enable.italics` instead.")
2024-08-22 10:03:02 -05:00
(lib.mkRemovedOptionModule (
basePluginPath ++ [ "boldVerticalSplit" ]
) "Use `colorschemes.rose-pine.settings.highlight_groups` instead.")
2024-08-22 10:03:02 -05:00
(lib.mkRemovedOptionModule (
basePluginPath ++ [ "transparentFloat" ]
) "Use `colorschemes.rose-pine.settings.highlight_groups.NormalFloat` instead.")
2024-08-22 10:03:02 -05:00
(lib.mkRenamedOptionModule (basePluginPath ++ [ "transparentBackground" ]) (
basePluginPath
++ [
"settings"
"enable"
"transparency"
2024-05-05 19:39:35 +02:00
]
))
];
settingsOptions = {
variant =
lib.nixvim.mkNullOrOption
2024-08-22 10:03:02 -05:00
(lib.types.enum [
"auto"
"main"
"moon"
"dawn"
])
''
Set the desired variant: "auto" will follow the vim background, defaulting to `dark_variant`
or "main" for dark and "dawn" for light.
'';
2024-05-05 19:39:35 +02:00
dark_variant =
defaultNullOpts.mkEnumFirstDefault
2024-05-05 19:39:35 +02:00
[
"main"
"moon"
2024-05-05 19:39:35 +02:00
"dawn"
]
''
Set the desired dark variant when `settings.variant` is set to "auto".
'';
2024-05-05 19:39:35 +02:00
dim_inactive_windows = defaultNullOpts.mkBool false ''
Differentiate between active and inactive windows and panels.
'';
2024-05-05 19:39:35 +02:00
extend_background_behind_borders = defaultNullOpts.mkBool true ''
Extend background behind borders.
Appearance differs based on which border characters you are using.
2024-05-05 19:39:35 +02:00
'';
enable = {
legacy_highlights = defaultNullOpts.mkBool true "Enable legacy highlights.";
2024-05-05 19:39:35 +02:00
migrations = defaultNullOpts.mkBool true "Enable migrations.";
2024-05-05 19:39:35 +02:00
terminal = defaultNullOpts.mkBool true "Enable terminal.";
};
styles = {
bold = defaultNullOpts.mkBool true "Enable bold.";
italic = defaultNullOpts.mkBool true "Enable italic.";
transparency = defaultNullOpts.mkBool true "Enable transparency.";
};
2024-08-22 10:03:02 -05:00
groups = mkNullOrOption (with lib.types; attrsOf (either str (attrsOf str))) ''
Highlight groups.
2024-05-05 19:39:35 +02:00
default: see [source](https://github.com/rose-pine/neovim/blob/main/lua/rose-pine/config.lua)
'';
2024-05-05 19:39:35 +02:00
2024-08-22 10:03:02 -05:00
highlight_groups = defaultNullOpts.mkAttrsOf lib.types.highlight { } ''
Custom highlight groups.
2024-05-05 19:39:35 +02:00
'';
before_highlight = defaultNullOpts.mkLuaFn "function(group, highlight, palette) end" ''
Called before each highlight group, before setting the highlight.
2024-05-05 19:39:35 +02:00
`function(group, highlight, palette)`
2024-05-05 19:39:35 +02:00
```lua
@param group string
@param highlight Highlight
@param palette Palette
2024-05-05 19:39:35 +02:00
```
'';
};
settingsExample = {
variant = "auto";
dark_variant = "moon";
dim_inactive_windows = true;
extend_background_behind_borders = true;
enable = {
legacy_highlights = false;
migrations = true;
terminal = false;
};
styles = {
bold = false;
italic = true;
transparency = true;
};
2024-05-05 19:39:35 +02:00
groups = {
border = "muted";
link = "iris";
panel = "surface";
2024-05-05 19:39:35 +02:00
};
highlight_groups = { };
before_highlight = "function(group, highlight, palette) end";
2024-05-05 19:39:35 +02:00
};
extraConfig = {
opts.termguicolors = lib.mkDefault true;
};
}