plugins/colorschemes: remove with lib;

This commit is contained in:
Austin Horstman 2024-08-22 10:03:02 -05:00
parent fba168aba7
commit 77cbd0313d
No known key found for this signature in database
13 changed files with 94 additions and 101 deletions

View file

@ -4,7 +4,6 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts toLuaObject; inherit (lib.nixvim) defaultNullOpts toLuaObject;
in in
@ -17,7 +16,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
colorscheme = null; colorscheme = null;
callSetup = false; callSetup = false;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
deprecateExtraOptions = true; deprecateExtraOptions = true;
optionsRenamedToSettings = [ optionsRenamedToSettings = [
@ -30,7 +29,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
Set to `true` to use `mirage` variant instead of `dark` for dark background. Set to `true` to use `mirage` variant instead of `dark` for dark background.
''; '';
overrides = defaultNullOpts.mkStrLuaOr (with types; attrsOf highlight) { } '' overrides = defaultNullOpts.mkStrLuaOr (with lib.types; attrsOf highlight) { } ''
A dictionary of group names, each associated with a dictionary of parameters A dictionary of group names, each associated with a dictionary of parameters
(`bg`, `fg`, `sp` and `style`) and colors in hex. (`bg`, `fg`, `sp` and `style`) and colors in hex.

View file

@ -4,7 +4,6 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts toLuaObject; inherit (lib.nixvim) defaultNullOpts toLuaObject;
@ -18,7 +17,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
defaultPackage = pkgs.vimPlugins.base16-nvim; defaultPackage = pkgs.vimPlugins.base16-nvim;
isColorscheme = true; isColorscheme = true;
maintainers = with maintainers; [ maintainers = with lib.maintainers; [
GaetanLepage GaetanLepage
MattSturgeon MattSturgeon
]; ];
@ -32,10 +31,10 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
]; ];
in in
[ [
(mkRenamedOptionModule (basePluginPath ++ [ "customColorScheme" ]) ( (lib.mkRenamedOptionModule (basePluginPath ++ [ "customColorScheme" ]) (
basePluginPath ++ [ "colorscheme" ] basePluginPath ++ [ "colorscheme" ]
)) ))
(mkRenamedOptionModule (basePluginPath ++ [ "useTruecolor" ]) [ (lib.mkRenamedOptionModule (basePluginPath ++ [ "useTruecolor" ]) [
"options" "options"
"termguicolors" "termguicolors"
]) ])
@ -92,11 +91,11 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
extraOptions = { extraOptions = {
colorscheme = colorscheme =
let let
customColorschemeType = types.submodule { customColorschemeType = lib.types.submodule {
options = mapAttrs ( options = lib.mapAttrs (
name: example: name: example:
mkOption { lib.mkOption {
type = with types; maybeRaw str; type = with lib.types; maybeRaw str;
description = "The value for color `${name}`."; description = "The value for color `${name}`.";
inherit example; inherit example;
} }
@ -125,19 +124,21 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
builtinColorschemeExamples = import ./theme-list.nix; builtinColorschemeExamples = import ./theme-list.nix;
in in
defaultNullOpts.mkNullable' { defaultNullOpts.mkNullable' {
type = types.oneOf [ type =
types.str with lib.types;
oneOf [
str
customColorschemeType customColorschemeType
types.rawLua rawLua
]; ];
pluginDefault = literalMD ''`vim.env.BASE16_THEME` or `"schemer-dark"`''; pluginDefault = lib.literalMD ''`vim.env.BASE16_THEME` or `"schemer-dark"`'';
description = '' description = ''
The base16 colorscheme to use. The base16 colorscheme to use.
You may use the name of a builtin colorscheme or an attrs that specifies the colors explicitly. You may use the name of a builtin colorscheme or an attrs that specifies the colors explicitly.
Examples of builtin themes include: Examples of builtin themes include:
${concatStrings ( ${lib.concatStrings (
map (e: '' map (e: ''
- "${e}" - "${e}"
'') builtinColorschemeExamples '') builtinColorschemeExamples
@ -158,8 +159,8 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
example = customColorschemeExample; example = customColorschemeExample;
}; };
setUpBar = mkOption { setUpBar = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = true; default = true;
example = false; example = false;
description = "Whether to set your status bar theme to 'base16'."; description = "Whether to set your status bar theme to 'base16'.";
@ -171,11 +172,11 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
callSetup = false; callSetup = false;
extraConfig = cfg: { extraConfig = cfg: {
plugins.airline.settings.theme = mkIf cfg.setUpBar (mkDefault name); plugins.airline.settings.theme = lib.mkIf cfg.setUpBar (lib.mkDefault name);
plugins.lualine.theme = mkIf cfg.setUpBar (mkDefault name); plugins.lualine.theme = lib.mkIf cfg.setUpBar (lib.mkDefault name);
plugins.lightline.colorscheme = mkDefault null; plugins.lightline.colorscheme = lib.mkDefault null;
opts.termguicolors = mkDefault true; opts.termguicolors = lib.mkDefault true;
# `settings` can either be passed to `with_config` before calling `setup`, # `settings` can either be passed to `with_config` before calling `setup`,
# or it can be passed as `setup`'s 2nd argument. # or it can be passed as `setup`'s 2nd argument.

View file

@ -4,16 +4,16 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrStrLuaFnOr; inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrStrLuaFnOr;
inherit (lib) types;
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin config { lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "catppuccin"; name = "catppuccin";
isColorscheme = true; isColorscheme = true;
defaultPackage = pkgs.vimPlugins.catppuccin-nvim; defaultPackage = pkgs.vimPlugins.catppuccin-nvim;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# TODO introduced 2024-03-27: remove 2024-05-27 # TODO introduced 2024-03-27: remove 2024-05-27
optionsRenamedToSettings = [ optionsRenamedToSettings = [
@ -92,10 +92,10 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
"integrations" "integrations"
]; ];
imports = imports =
mapAttrsToList lib.mapAttrsToList
( (
old: new: old: new:
mkRenamedOptionModule lib.mkRenamedOptionModule
[ [
"colorschemes" "colorschemes"
"catppuccin" "catppuccin"
@ -236,7 +236,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
''; '';
}; };
color_overrides = genAttrs (flavours ++ [ "all" ]) ( color_overrides = lib.genAttrs (flavours ++ [ "all" ]) (
flavour: flavour:
defaultNullOpts.mkAttrsOf types.str { } ( defaultNullOpts.mkAttrsOf types.str { } (
if flavour == "all" then if flavour == "all" then
@ -318,5 +318,5 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
}; };
}; };
extraConfig = cfg: { opts.termguicolors = mkDefault true; }; extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
} }

View file

@ -4,7 +4,6 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;
in in
@ -38,7 +37,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
''; '';
theme = { theme = {
highlights = defaultNullOpts.mkAttrsOf types.highlight { } '' highlights = defaultNullOpts.mkAttrsOf lib.types.highlight { } ''
Highlight groups to override, adding new groups is also possible. Highlight groups to override, adding new groups is also possible.
See `:h highlight-groups` for a list of highlight groups. See `:h highlight-groups` for a list of highlight groups.
@ -57,7 +56,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
Complete list can be found in `lua/cyberdream/theme.lua` in upstream repository. Complete list can be found in `lua/cyberdream/theme.lua` in upstream repository.
''; '';
colors = defaultNullOpts.mkAttrsOf types.str { } '' colors = defaultNullOpts.mkAttrsOf lib.types.str { } ''
Override the default colors used. Override the default colors used.
For a full list of colors, see upstream documentation. For a full list of colors, see upstream documentation.

View file

@ -4,57 +4,57 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib) types;
cfg = config.colorschemes.dracula; cfg = config.colorschemes.dracula;
in in
{ {
options = { options = {
colorschemes.dracula = { colorschemes.dracula = {
enable = mkEnableOption "dracula"; enable = lib.mkEnableOption "dracula";
package = lib.nixvim.mkPluginPackageOption "dracula" pkgs.vimPlugins.dracula-vim; package = lib.nixvim.mkPluginPackageOption "dracula" pkgs.vimPlugins.dracula-vim;
bold = mkOption { bold = lib.mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Include bold attributes in highlighting"; description = "Include bold attributes in highlighting";
}; };
italic = mkOption { italic = lib.mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Include italic attributes in highlighting"; description = "Include italic attributes in highlighting";
}; };
underline = mkOption { underline = lib.mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Include underline attributes in highlighting"; description = "Include underline attributes in highlighting";
}; };
undercurl = mkOption { undercurl = lib.mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Include undercurl attributes in highlighting (only if underline enabled)"; description = "Include undercurl attributes in highlighting (only if underline enabled)";
}; };
fullSpecialAttrsSupport = mkOption { fullSpecialAttrsSupport = lib.mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = "Explicitly declare full support for special attributes. On terminal emulators, set to 1 to allow underline/undercurl highlights without changing the foreground color"; description = "Explicitly declare full support for special attributes. On terminal emulators, set to 1 to allow underline/undercurl highlights without changing the foreground color";
}; };
highContrastDiff = mkOption { highContrastDiff = lib.mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
description = "Use high-contrast color when in diff mode"; description = "Use high-contrast color when in diff mode";
}; };
inverse = mkOption { inverse = lib.mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Include inverse attributes in highlighting"; description = "Include inverse attributes in highlighting";
}; };
colorterm = mkOption { colorterm = lib.mkOption {
type = types.bool; type = types.bool;
default = true; default = true;
description = "Include background fill colors"; description = "Include background fill colors";
@ -62,21 +62,21 @@ in
}; };
}; };
config = mkIf cfg.enable { config = lib.mkIf cfg.enable {
colorscheme = "dracula"; colorscheme = "dracula";
extraPlugins = [ cfg.package ]; extraPlugins = [ cfg.package ];
globals = { globals = {
dracula_bold = mkIf (!cfg.bold) 0; dracula_bold = lib.mkIf (!cfg.bold) 0;
dracula_italic = mkIf (!cfg.italic) 0; dracula_italic = lib.mkIf (!cfg.italic) 0;
dracula_underline = mkIf (!cfg.underline) 0; dracula_underline = lib.mkIf (!cfg.underline) 0;
dracula_undercurl = mkIf (!cfg.undercurl) 0; dracula_undercurl = lib.mkIf (!cfg.undercurl) 0;
dracula_full_special_attrs_support = mkIf cfg.fullSpecialAttrsSupport 1; dracula_full_special_attrs_support = lib.mkIf cfg.fullSpecialAttrsSupport 1;
dracula_high_contrast_diff = mkIf cfg.highContrastDiff 1; dracula_high_contrast_diff = lib.mkIf cfg.highContrastDiff 1;
dracula_inverse = mkIf (!cfg.inverse) 0; dracula_inverse = lib.mkIf (!cfg.inverse) 0;
dracula_colorterm = mkIf (!cfg.colorterm) 0; dracula_colorterm = lib.mkIf (!cfg.colorterm) 0;
}; };
opts.termguicolors = mkDefault true; opts.termguicolors = lib.mkDefault true;
}; };
} }

View file

@ -4,9 +4,9 @@
config, config,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;
inherit (lib) types;
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin config { lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "kanagawa"; name = "kanagawa";
@ -20,7 +20,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
- Set `colorschemes.kanagawa.settings.background` (the active theme will depend on the value of `vim.o.background`). - Set `colorschemes.kanagawa.settings.background` (the active theme will depend on the value of `vim.o.background`).
''; '';
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# TODO introduced 2024-03-15: remove 2024-05-15 # TODO introduced 2024-03-15: remove 2024-05-15
deprecateExtraOptions = true; deprecateExtraOptions = true;
@ -34,7 +34,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
(map (map
( (
optionPath: optionPath:
mkRenamedOptionModule (basePluginPath ++ optionPath) ( lib.mkRenamedOptionModule (basePluginPath ++ optionPath) (
basePluginPath ++ [ "settings" ] ++ optionPath basePluginPath ++ [ "settings" ] ++ optionPath
) )
) )
@ -69,7 +69,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
] ]
) )
++ [ ++ [
(mkRemovedOptionModule (basePluginPath ++ [ "overrides" ]) '' (lib.mkRemovedOptionModule (basePluginPath ++ [ "overrides" ]) ''
Use `colorschemes.kanagawa.settings.overrides` but you now have to add the full function definition: Use `colorschemes.kanagawa.settings.overrides` but you now have to add the full function definition:
``` ```
function(colors) function(colors)

View file

@ -4,14 +4,13 @@
pkgs, pkgs,
... ...
}: }:
with lib;
lib.nixvim.vim-plugin.mkVimPlugin config { lib.nixvim.vim-plugin.mkVimPlugin config {
name = "melange"; name = "melange";
isColorscheme = true; isColorscheme = true;
originalName = "melange-nvim"; originalName = "melange-nvim";
defaultPackage = pkgs.vimPlugins.melange-nvim; defaultPackage = pkgs.vimPlugins.melange-nvim;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraConfig = cfg: { opts.termguicolors = mkDefault true; }; extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
} }

View file

@ -4,9 +4,9 @@
config, config,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption; inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
inherit (lib) types;
in in
lib.nixvim.neovim-plugin.mkNeovimPlugin config { lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "nightfox"; name = "nightfox";
@ -14,11 +14,11 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
originalName = "nightfox.nvim"; originalName = "nightfox.nvim";
defaultPackage = pkgs.vimPlugins.nightfox-nvim; defaultPackage = pkgs.vimPlugins.nightfox-nvim;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
colorscheme = null; colorscheme = null;
extraOptions = { extraOptions = {
flavor = mkOption { flavor = lib.mkOption {
type = types.enum [ type = types.enum [
"carbonfox" "carbonfox"
"dawnfox" "dawnfox"
@ -33,7 +33,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
description = "Which palette/flavor to use as the colorscheme."; description = "Which palette/flavor to use as the colorscheme.";
}; };
}; };
extraConfig = cfg: { colorscheme = mkDefault cfg.flavor; }; extraConfig = cfg: { colorscheme = lib.mkDefault cfg.flavor; };
settingsOptions = { settingsOptions = {
options = { options = {
@ -132,7 +132,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
''; '';
severity = severity =
mapAttrs lib.mapAttrs
( (
name: color: name: color:
defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0 '' defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0 ''

View file

@ -4,7 +4,6 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;
in in
@ -14,7 +13,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
originalName = "palette.nvim"; originalName = "palette.nvim";
defaultPackage = pkgs.vimPlugins.palette-nvim; defaultPackage = pkgs.vimPlugins.palette-nvim;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
extraPlugins = [ extraPlugins = [
# Annoyingly, lspconfig is required, otherwise this line is breaking: # Annoyingly, lspconfig is required, otherwise this line is breaking:
@ -50,15 +49,15 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
}; };
customPalettes = customPalettes =
mapAttrs lib.mapAttrs
( (
name: colorNames: name: colorNames:
defaultNullOpts.mkAttrsOf defaultNullOpts.mkAttrsOf
(types.submodule { (lib.types.submodule {
options = genAttrs colorNames ( options = lib.genAttrs colorNames (
colorName: colorName:
mkOption { lib.mkOption {
type = types.str; type = lib.types.str;
description = "Definition of color '${colorName}'"; description = "Definition of color '${colorName}'";
} }
); );
@ -121,19 +120,19 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
extraConfig = cfg: { extraConfig = cfg: {
assertions = assertions =
mapAttrsToList lib.mapAttrsToList
( (
name: defaultPaletteNames: name: defaultPaletteNames:
let let
customPalettesNames = attrNames cfg.settings.custom_palettes.${name}; customPalettesNames = lib.attrNames cfg.settings.custom_palettes.${name};
allowedPaletteNames = customPalettesNames ++ defaultPaletteNames; allowedPaletteNames = customPalettesNames ++ defaultPaletteNames;
palette = cfg.settings.palettes.${name}; palette = cfg.settings.palettes.${name};
in in
{ {
assertion = isString palette -> elem palette allowedPaletteNames; assertion = lib.isString palette -> lib.elem palette allowedPaletteNames;
message = '' message = ''
Nixvim (colorschemes.palette): `settings.palettes.${name}` (${palette}") is not part of the allowed ${name} palette names (${concatStringsSep " " allowedPaletteNames}). Nixvim (colorschemes.palette): `settings.palettes.${name}` (${palette}") is not part of the allowed ${name} palette names (${lib.concatStringsSep " " allowedPaletteNames}).
''; '';
} }
) )

View file

@ -4,7 +4,6 @@
config, config,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption; inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
in in
@ -14,7 +13,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
originalName = "poimandres.nvim"; originalName = "poimandres.nvim";
defaultPackage = pkgs.vimPlugins.poimandres-nvim; defaultPackage = pkgs.vimPlugins.poimandres-nvim;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# TODO introduced 2024-04-15: remove 2024-06-15 # TODO introduced 2024-04-15: remove 2024-06-15
deprecateExtraOptions = true; deprecateExtraOptions = true;
@ -54,13 +53,13 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
Dark variant. Dark variant.
''; '';
groups = mkNullOrOption (with types; attrsOf (either str (attrsOf str))) '' groups = mkNullOrOption (with lib.types; attrsOf (either str (attrsOf str))) ''
Which color to use for each group. Which color to use for each group.
default: see [source](https://github.com/olivercederborg/poimandres.nvim/blob/main/lua/poimandres/init.lua) default: see [source](https://github.com/olivercederborg/poimandres.nvim/blob/main/lua/poimandres/init.lua)
''; '';
highlight_groups = defaultNullOpts.mkAttrsOf types.str { } '' highlight_groups = defaultNullOpts.mkAttrsOf lib.types.str { } ''
Highlight groups. Highlight groups.
''; '';
}; };

View file

@ -4,7 +4,6 @@
config, config,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption; inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
in in
@ -13,7 +12,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
isColorscheme = true; isColorscheme = true;
defaultPackage = pkgs.vimPlugins.rose-pine; defaultPackage = pkgs.vimPlugins.rose-pine;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# TODO introduced 2024-04-15: remove 2024-06-15 # TODO introduced 2024-04-15: remove 2024-06-15
optionsRenamedToSettings = [ optionsRenamedToSettings = [
@ -28,30 +27,30 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
]; ];
in in
[ [
(mkRenamedOptionModule (basePluginPath ++ [ "style" ]) ( (lib.mkRenamedOptionModule (basePluginPath ++ [ "style" ]) (
basePluginPath basePluginPath
++ [ ++ [
"settings" "settings"
"dark_variant" "dark_variant"
] ]
)) ))
(mkRenamedOptionModule (basePluginPath ++ [ "dimInactive" ]) ( (lib.mkRenamedOptionModule (basePluginPath ++ [ "dimInactive" ]) (
basePluginPath basePluginPath
++ [ ++ [
"settings" "settings"
"dim_inactive_windows" "dim_inactive_windows"
] ]
)) ))
(mkRemovedOptionModule ( (lib.mkRemovedOptionModule (
basePluginPath ++ [ "disableItalics" ] basePluginPath ++ [ "disableItalics" ]
) "Use `colorschemes.rose-pine.settings.enable.italics` instead.") ) "Use `colorschemes.rose-pine.settings.enable.italics` instead.")
(mkRemovedOptionModule ( (lib.mkRemovedOptionModule (
basePluginPath ++ [ "boldVerticalSplit" ] basePluginPath ++ [ "boldVerticalSplit" ]
) "Use `colorschemes.rose-pine.settings.highlight_groups` instead.") ) "Use `colorschemes.rose-pine.settings.highlight_groups` instead.")
(mkRemovedOptionModule ( (lib.mkRemovedOptionModule (
basePluginPath ++ [ "transparentFloat" ] basePluginPath ++ [ "transparentFloat" ]
) "Use `colorschemes.rose-pine.settings.highlight_groups.NormalFloat` instead.") ) "Use `colorschemes.rose-pine.settings.highlight_groups.NormalFloat` instead.")
(mkRenamedOptionModule (basePluginPath ++ [ "transparentBackground" ]) ( (lib.mkRenamedOptionModule (basePluginPath ++ [ "transparentBackground" ]) (
basePluginPath basePluginPath
++ [ ++ [
"settings" "settings"
@ -64,7 +63,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
settingsOptions = { settingsOptions = {
variant = variant =
lib.nixvim.mkNullOrOption lib.nixvim.mkNullOrOption
(types.enum [ (lib.types.enum [
"auto" "auto"
"main" "main"
"moon" "moon"
@ -111,13 +110,13 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
transparency = defaultNullOpts.mkBool true "Enable transparency."; transparency = defaultNullOpts.mkBool true "Enable transparency.";
}; };
groups = mkNullOrOption (with types; attrsOf (either str (attrsOf str))) '' groups = mkNullOrOption (with lib.types; attrsOf (either str (attrsOf str))) ''
Highlight groups. Highlight groups.
default: see [source](https://github.com/rose-pine/neovim/blob/main/lua/rose-pine/config.lua) default: see [source](https://github.com/rose-pine/neovim/blob/main/lua/rose-pine/config.lua)
''; '';
highlight_groups = defaultNullOpts.mkAttrsOf types.highlight { } '' highlight_groups = defaultNullOpts.mkAttrsOf lib.types.highlight { } ''
Custom highlight groups. Custom highlight groups.
''; '';
@ -158,5 +157,5 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
before_highlight = "function(group, highlight, palette) end"; before_highlight = "function(group, highlight, palette) end";
}; };
extraConfig = cfg: { opts.termguicolors = mkDefault true; }; extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
} }

View file

@ -4,7 +4,6 @@
config, config,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts; inherit (lib.nixvim) defaultNullOpts;
in in
@ -14,7 +13,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
originalName = "tokyonight.nvim"; originalName = "tokyonight.nvim";
defaultPackage = pkgs.vimPlugins.tokyonight-nvim; defaultPackage = pkgs.vimPlugins.tokyonight-nvim;
maintainers = [ maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
# TODO introduced 2024-04-15: remove 2024-06-15 # TODO introduced 2024-04-15: remove 2024-06-15
optionsRenamedToSettings = [ optionsRenamedToSettings = [
@ -111,7 +110,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
}; };
sidebars = sidebars =
defaultNullOpts.mkListOf types.str defaultNullOpts.mkListOf lib.types.str
[ [
"qf" "qf"
"help" "help"
@ -120,7 +119,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
Set a darker background on sidebar-like windows. Set a darker background on sidebar-like windows.
''; '';
day_brightness = defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.3 '' day_brightness = defaultNullOpts.mkNullable (lib.types.numbers.between 0.0 1.0) 0.3 ''
Adjusts the brightness of the colors of the **Day** style. Adjusts the brightness of the colors of the **Day** style.
Number between 0 and 1, from dull to vibrant colors. Number between 0 and 1, from dull to vibrant colors.
''; '';
@ -179,5 +178,5 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
on_highlights = "function(highlights, colors) end"; on_highlights = "function(highlights, colors) end";
}; };
extraConfig = cfg: { opts.termguicolors = mkDefault true; }; extraConfig = cfg: { opts.termguicolors = lib.mkDefault true; };
} }

View file

@ -4,7 +4,6 @@
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib.nixvim) defaultNullOpts toLuaObject; inherit (lib.nixvim) defaultNullOpts toLuaObject;
in in
@ -16,18 +15,18 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin config {
colorscheme = null; # Color scheme is set by `require.("vscode").load()` colorscheme = null; # Color scheme is set by `require.("vscode").load()`
callSetup = false; callSetup = false;
maintainers = [ maintainers.loicreynier ]; maintainers = [ lib.maintainers.loicreynier ];
settingsOptions = { settingsOptions = {
transparent = defaultNullOpts.mkBool false "Whether to enable transparent background"; transparent = defaultNullOpts.mkBool false "Whether to enable transparent background";
italic_comments = defaultNullOpts.mkBool false "Whether to enable italic comments"; italic_comments = defaultNullOpts.mkBool false "Whether to enable italic comments";
underline_links = defaultNullOpts.mkBool false "Whether to underline links"; underline_links = defaultNullOpts.mkBool false "Whether to underline links";
disable_nvimtree_bg = defaultNullOpts.mkBool true "Whether to disable nvim-tree background"; disable_nvimtree_bg = defaultNullOpts.mkBool true "Whether to disable nvim-tree background";
color_overrides = defaultNullOpts.mkAttrsOf types.str { } '' color_overrides = defaultNullOpts.mkAttrsOf lib.types.str { } ''
A dictionary of color overrides. A dictionary of color overrides.
See https://github.com/Mofiqul/vscode.nvim/blob/main/lua/vscode/colors.lua for color names. See https://github.com/Mofiqul/vscode.nvim/blob/main/lua/vscode/colors.lua for color names.
''; '';
group_overrides = defaultNullOpts.mkAttrsOf types.highlight { } '' group_overrides = defaultNullOpts.mkAttrsOf lib.types.highlight { } ''
A dictionary of group names, each associated with a dictionary of parameters A dictionary of group names, each associated with a dictionary of parameters
(`bg`, `fg`, `sp` and `style`) and colors in hex. (`bg`, `fg`, `sp` and `style`) and colors in hex.
''; '';