plugins/colorschemes: migrate helpers -> lib.nixvim

This commit is contained in:
Austin Horstman 2024-08-22 09:24:17 -05:00
parent b470800240
commit fba168aba7
No known key found for this signature in database
20 changed files with 236 additions and 220 deletions

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts toLuaObject;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "ayu"; name = "ayu";
isColorscheme = true; isColorscheme = true;
originalName = "neovim-ayu"; originalName = "neovim-ayu";
@ -24,11 +26,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
]; ];
settingsOptions = { settingsOptions = {
mirage = helpers.defaultNullOpts.mkBool false '' mirage = defaultNullOpts.mkBool false ''
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 = helpers.defaultNullOpts.mkStrLuaOr (with helpers.nixvimTypes; attrsOf highlight) { } '' overrides = defaultNullOpts.mkStrLuaOr (with 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.
@ -42,7 +44,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
extraConfig = cfg: { extraConfig = cfg: {
extraConfigLuaPre = '' extraConfigLuaPre = ''
local ayu = require("ayu") local ayu = require("ayu")
ayu.setup(${helpers.toLuaObject cfg.settings}) ayu.setup(${toLuaObject cfg.settings})
ayu.colorscheme() ayu.colorscheme()
''; '';
}; };

View file

@ -1,17 +1,18 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
let let
inherit (lib.nixvim) defaultNullOpts toLuaObject;
name = "base16"; name = "base16";
luaName = "base16-colorscheme"; luaName = "base16-colorscheme";
originalName = "base16.nvim"; originalName = "base16.nvim";
in in
helpers.neovim-plugin.mkNeovimPlugin config { lib.nixvim.neovim-plugin.mkNeovimPlugin config {
inherit name luaName originalName; inherit name luaName originalName;
setup = ".with_config"; setup = ".with_config";
defaultPackage = pkgs.vimPlugins.base16-nvim; defaultPackage = pkgs.vimPlugins.base16-nvim;
@ -47,43 +48,43 @@ helpers.neovim-plugin.mkNeovimPlugin config {
}; };
settingsOptions = { settingsOptions = {
telescope = helpers.defaultNullOpts.mkBool true '' telescope = defaultNullOpts.mkBool true ''
Whether to enable telescope integration. Whether to enable telescope integration.
''; '';
telescope_borders = helpers.defaultNullOpts.mkBool false '' telescope_borders = defaultNullOpts.mkBool false ''
Whether to display borders around telescope's panel. Whether to display borders around telescope's panel.
''; '';
indentblankline = helpers.defaultNullOpts.mkBool true '' indentblankline = defaultNullOpts.mkBool true ''
Whether to enable indentblankline integration. Whether to enable indentblankline integration.
''; '';
notify = helpers.defaultNullOpts.mkBool true '' notify = defaultNullOpts.mkBool true ''
Whether to enable notify integration. Whether to enable notify integration.
''; '';
ts_rainbow = helpers.defaultNullOpts.mkBool true '' ts_rainbow = defaultNullOpts.mkBool true ''
Whether to enable ts_rainbow integration. Whether to enable ts_rainbow integration.
''; '';
cmp = helpers.defaultNullOpts.mkBool true '' cmp = defaultNullOpts.mkBool true ''
Whether to enable cmp integration. Whether to enable cmp integration.
''; '';
illuminate = helpers.defaultNullOpts.mkBool true '' illuminate = defaultNullOpts.mkBool true ''
Whether to enable illuminate integration. Whether to enable illuminate integration.
''; '';
lsp_semantic = helpers.defaultNullOpts.mkBool true '' lsp_semantic = defaultNullOpts.mkBool true ''
Whether to enable lsp_semantic integration. Whether to enable lsp_semantic integration.
''; '';
mini_completion = helpers.defaultNullOpts.mkBool true '' mini_completion = defaultNullOpts.mkBool true ''
Whether to enable mini_completion integration. Whether to enable mini_completion integration.
''; '';
dapui = helpers.defaultNullOpts.mkBool true '' dapui = defaultNullOpts.mkBool true ''
Whether to enable dapui integration. Whether to enable dapui integration.
''; '';
}; };
@ -95,7 +96,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
options = mapAttrs ( options = mapAttrs (
name: example: name: example:
mkOption { mkOption {
type = with helpers.nixvimTypes; maybeRaw str; type = with types; maybeRaw str;
description = "The value for color `${name}`."; description = "The value for color `${name}`.";
inherit example; inherit example;
} }
@ -123,11 +124,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
builtinColorschemeExamples = import ./theme-list.nix; builtinColorschemeExamples = import ./theme-list.nix;
in in
helpers.defaultNullOpts.mkNullable' { defaultNullOpts.mkNullable' {
type = types.oneOf [ type = types.oneOf [
types.str types.str
customColorschemeType customColorschemeType
helpers.nixvimTypes.rawLua types.rawLua
]; ];
pluginDefault = literalMD ''`vim.env.BASE16_THEME` or `"schemer-dark"`''; pluginDefault = literalMD ''`vim.env.BASE16_THEME` or `"schemer-dark"`'';
description = '' description = ''
@ -182,8 +183,8 @@ helpers.neovim-plugin.mkNeovimPlugin config {
extraConfigLuaPre = '' extraConfigLuaPre = ''
do do
local base16 = require('${luaName}') local base16 = require('${luaName}')
base16.with_config(${helpers.toLuaObject cfg.settings}) base16.with_config(${toLuaObject cfg.settings})
base16.setup(${helpers.toLuaObject cfg.colorscheme}) base16.setup(${toLuaObject cfg.colorscheme})
end end
''; '';
}; };

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption mkNullOrStrLuaFnOr;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "catppuccin"; name = "catppuccin";
isColorscheme = true; isColorscheme = true;
defaultPackage = pkgs.vimPlugins.catppuccin-nvim; defaultPackage = pkgs.vimPlugins.catppuccin-nvim;
@ -124,11 +126,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
]; ];
in in
{ {
compile_path = helpers.defaultNullOpts.mkStr { compile_path = defaultNullOpts.mkStr {
__raw = "vim.fn.stdpath 'cache' .. '/catppuccin'"; __raw = "vim.fn.stdpath 'cache' .. '/catppuccin'";
} "Set the compile cache directory."; } "Set the compile cache directory.";
flavour = helpers.mkNullOrOption (types.enum (flavours ++ [ "auto" ])) '' flavour = mkNullOrOption (types.enum (flavours ++ [ "auto" ])) ''
Theme flavour. Theme flavour.
''; '';
@ -136,7 +138,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
let let
mkBackgroundStyle = mkBackgroundStyle =
name: name:
helpers.defaultNullOpts.mkEnumFirstDefault flavours '' defaultNullOpts.mkEnumFirstDefault flavours ''
Background for `${name}` background. Background for `${name}` background.
''; '';
in in
@ -146,97 +148,97 @@ helpers.neovim-plugin.mkNeovimPlugin config {
dark = mkBackgroundStyle "dark"; dark = mkBackgroundStyle "dark";
}; };
transparent_background = helpers.defaultNullOpts.mkBool false '' transparent_background = defaultNullOpts.mkBool false ''
Enable Transparent background. Enable Transparent background.
''; '';
show_end_of_buffer = helpers.defaultNullOpts.mkBool false '' show_end_of_buffer = defaultNullOpts.mkBool false ''
Show the '~' characters after the end of buffers. Show the '~' characters after the end of buffers.
''; '';
term_colors = helpers.defaultNullOpts.mkBool false '' term_colors = defaultNullOpts.mkBool false ''
Configure the colors used when opening a :terminal in Neovim. Configure the colors used when opening a :terminal in Neovim.
''; '';
dim_inactive = { dim_inactive = {
enabled = helpers.defaultNullOpts.mkBool false '' enabled = defaultNullOpts.mkBool false ''
If true, dims the background color of inactive window or buffer or split. If true, dims the background color of inactive window or buffer or split.
''; '';
shade = helpers.defaultNullOpts.mkStr "dark" '' shade = defaultNullOpts.mkStr "dark" ''
Sets the shade to apply to the inactive split or window or buffer. Sets the shade to apply to the inactive split or window or buffer.
''; '';
percentage = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.15 '' percentage = defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.15 ''
percentage of the shade to apply to the inactive window, split or buffer. percentage of the shade to apply to the inactive window, split or buffer.
''; '';
}; };
no_italic = helpers.defaultNullOpts.mkBool false '' no_italic = defaultNullOpts.mkBool false ''
Force no italic. Force no italic.
''; '';
no_bold = helpers.defaultNullOpts.mkBool false '' no_bold = defaultNullOpts.mkBool false ''
Force no bold. Force no bold.
''; '';
no_underline = helpers.defaultNullOpts.mkBool false '' no_underline = defaultNullOpts.mkBool false ''
Force no underline. Force no underline.
''; '';
styles = { styles = {
comments = helpers.defaultNullOpts.mkListOf types.str [ "italic" ] '' comments = defaultNullOpts.mkListOf types.str [ "italic" ] ''
Define comments highlight properties. Define comments highlight properties.
''; '';
conditionals = helpers.defaultNullOpts.mkListOf types.str [ "italic" ] '' conditionals = defaultNullOpts.mkListOf types.str [ "italic" ] ''
Define conditionals highlight properties. Define conditionals highlight properties.
''; '';
loops = helpers.defaultNullOpts.mkListOf types.str [ ] '' loops = defaultNullOpts.mkListOf types.str [ ] ''
Define loops highlight properties. Define loops highlight properties.
''; '';
functions = helpers.defaultNullOpts.mkListOf types.str [ ] '' functions = defaultNullOpts.mkListOf types.str [ ] ''
Define functions highlight properties. Define functions highlight properties.
''; '';
keywords = helpers.defaultNullOpts.mkListOf types.str [ ] '' keywords = defaultNullOpts.mkListOf types.str [ ] ''
Define keywords highlight properties. Define keywords highlight properties.
''; '';
strings = helpers.defaultNullOpts.mkListOf types.str [ ] '' strings = defaultNullOpts.mkListOf types.str [ ] ''
Define strings highlight properties. Define strings highlight properties.
''; '';
variables = helpers.defaultNullOpts.mkListOf types.str [ ] '' variables = defaultNullOpts.mkListOf types.str [ ] ''
Define variables highlight properties. Define variables highlight properties.
''; '';
numbers = helpers.defaultNullOpts.mkListOf types.str [ ] '' numbers = defaultNullOpts.mkListOf types.str [ ] ''
Define numbers highlight properties. Define numbers highlight properties.
''; '';
booleans = helpers.defaultNullOpts.mkListOf types.str [ ] '' booleans = defaultNullOpts.mkListOf types.str [ ] ''
Define booleans highlight properties. Define booleans highlight properties.
''; '';
properties = helpers.defaultNullOpts.mkListOf types.str [ ] '' properties = defaultNullOpts.mkListOf types.str [ ] ''
Define properties highlight properties. Define properties highlight properties.
''; '';
types = helpers.defaultNullOpts.mkListOf types.str [ ] '' types = defaultNullOpts.mkListOf types.str [ ] ''
Define types highlight properties. Define types highlight properties.
''; '';
operators = helpers.defaultNullOpts.mkListOf types.str [ ] '' operators = defaultNullOpts.mkListOf types.str [ ] ''
Define operators highlight properties. Define operators highlight properties.
''; '';
}; };
color_overrides = genAttrs (flavours ++ [ "all" ]) ( color_overrides = genAttrs (flavours ++ [ "all" ]) (
flavour: flavour:
helpers.defaultNullOpts.mkAttrsOf types.str { } ( defaultNullOpts.mkAttrsOf types.str { } (
if flavour == "all" then if flavour == "all" then
"Override colors for all the flavours." "Override colors for all the flavours."
else else
@ -244,7 +246,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
) )
); );
custom_highlights = helpers.mkNullOrStrLuaFnOr (with types; attrsOf anything) '' custom_highlights = mkNullOrStrLuaFnOr (with types; attrsOf anything) ''
Override specific highlight groups to use other groups or a hex color. Override specific highlight groups to use other groups or a hex color.
You can provide either a lua function or directly an attrs. You can provide either a lua function or directly an attrs.
@ -262,11 +264,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
Default: `{}` Default: `{}`
''; '';
default_integrations = helpers.defaultNullOpts.mkBool true '' default_integrations = defaultNullOpts.mkBool true ''
Some integrations are enabled by default, you can control this behaviour with this option. Some integrations are enabled by default, you can control this behaviour with this option.
''; '';
integrations = helpers.mkNullOrOption (with types; attrsOf anything) '' integrations = mkNullOrOption (with types; attrsOf anything) ''
Catppuccin provides theme support for other plugins in the Neovim ecosystem and extended Catppuccin provides theme support for other plugins in the Neovim ecosystem and extended
Neovim functionality through _integrations_. Neovim functionality through _integrations_.

View file

@ -1,42 +1,44 @@
{ {
config, config,
lib, lib,
helpers,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "cyberdream"; name = "cyberdream";
isColorscheme = true; isColorscheme = true;
originalName = "cyberdream.nvim"; originalName = "cyberdream.nvim";
defaultPackage = pkgs.vimPlugins.cyberdream-nvim; defaultPackage = pkgs.vimPlugins.cyberdream-nvim;
maintainers = [ helpers.maintainers.AndresBermeoMarinelli ]; maintainers = [ lib.nixvim.maintainers.AndresBermeoMarinelli ];
settingsOptions = { settingsOptions = {
transparent = helpers.defaultNullOpts.mkBool false '' transparent = defaultNullOpts.mkBool false ''
Enable transparent background. Enable transparent background.
''; '';
italic_comments = helpers.defaultNullOpts.mkBool false '' italic_comments = defaultNullOpts.mkBool false ''
Enable italics comments. Enable italics comments.
''; '';
hide_fillchars = helpers.defaultNullOpts.mkBool false '' hide_fillchars = defaultNullOpts.mkBool false ''
Replace all fillchars with ' ' for the ultimate clean look. Replace all fillchars with ' ' for the ultimate clean look.
''; '';
borderless_telescope = helpers.defaultNullOpts.mkBool true '' borderless_telescope = defaultNullOpts.mkBool true ''
Modern borderless telescope theme. Modern borderless telescope theme.
''; '';
terminal_colors = helpers.defaultNullOpts.mkBool true '' terminal_colors = defaultNullOpts.mkBool true ''
Set terminal colors used in `:terminal`. Set terminal colors used in `:terminal`.
''; '';
theme = { theme = {
highlights = helpers.defaultNullOpts.mkAttrsOf helpers.nixvimTypes.highlight { } '' highlights = defaultNullOpts.mkAttrsOf 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.
@ -55,7 +57,7 @@ helpers.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 = helpers.defaultNullOpts.mkAttrsOf types.str { } '' colors = defaultNullOpts.mkAttrsOf 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

@ -1,6 +1,5 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
@ -14,7 +13,7 @@ in
colorschemes.dracula = { colorschemes.dracula = {
enable = mkEnableOption "dracula"; enable = mkEnableOption "dracula";
package = helpers.mkPluginPackageOption "dracula" pkgs.vimPlugins.dracula-vim; package = lib.nixvim.mkPluginPackageOption "dracula" pkgs.vimPlugins.dracula-vim;
bold = mkOption { bold = mkOption {
type = types.bool; type = types.bool;

View file

@ -1,30 +1,31 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
let let
inherit (lib.nixvim) defaultNullOpts;
mkEverforestBool = mkEverforestBool =
pluginDefault: desc: pluginDefault: desc:
helpers.defaultNullOpts.mkEnum [ defaultNullOpts.mkEnum [
0 0
1 1
] pluginDefault desc; ] pluginDefault desc;
in in
helpers.vim-plugin.mkVimPlugin config { lib.nixvim.vim-plugin.mkVimPlugin config {
name = "everforest"; name = "everforest";
isColorscheme = true; isColorscheme = true;
defaultPackage = pkgs.vimPlugins.everforest; defaultPackage = pkgs.vimPlugins.everforest;
globalPrefix = "everforest_"; globalPrefix = "everforest_";
maintainers = [ helpers.maintainers.sheemap ]; maintainers = [ lib.nixvim.maintainers.sheemap ];
settingsOptions = { settingsOptions = {
background = background =
helpers.defaultNullOpts.mkEnum defaultNullOpts.mkEnum
[ [
"hard" "hard"
"medium" "medium"
@ -44,7 +45,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
cursor = cursor =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"auto" "auto"
"red" "red"
@ -60,7 +61,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
transparent_background = transparent_background =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
0 0
1 1
@ -83,7 +84,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
sign_column_background = sign_column_background =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"none" "none"
"grey" "grey"
@ -94,7 +95,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
spell_foreground = spell_foreground =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"none" "none"
"colored" "colored"
@ -106,7 +107,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
ui_contrast = ui_contrast =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"low" "low"
"high" "high"
@ -120,7 +121,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
float_style = float_style =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"bright" "bright"
"dim" "dim"
@ -165,7 +166,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
diagnostic_virtual_text = diagnostic_virtual_text =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"grey" "grey"
"colored" "colored"
@ -187,7 +188,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
current_word = current_word =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"grey background" "grey background"
"bold" "bold"
@ -211,7 +212,7 @@ helpers.vim-plugin.mkVimPlugin config {
''; '';
inlay_hints_background = inlay_hints_background =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"none" "none"
"dimmed" "dimmed"
@ -240,7 +241,7 @@ helpers.vim-plugin.mkVimPlugin config {
lightline color scheme, set this option to `1`. lightline color scheme, set this option to `1`.
''; '';
colors_override = helpers.defaultNullOpts.mkAttrsOf (lib.types.listOf lib.types.str) { } '' colors_override = defaultNullOpts.mkAttrsOf (lib.types.listOf lib.types.str) { } ''
Override color palette. The available keys can be found in the plugin's [source code](https://github.com/sainnhe/everforest/blob/master/autoload/everforest.vim) Override color palette. The available keys can be found in the plugin's [source code](https://github.com/sainnhe/everforest/blob/master/autoload/everforest.vim)
''; '';

View file

@ -1,11 +1,10 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
helpers.neovim-plugin.mkNeovimPlugin config { lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "gruvbox"; name = "gruvbox";
isColorscheme = true; isColorscheme = true;
originalName = "gruvbox.nvim"; originalName = "gruvbox.nvim";
@ -23,7 +22,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
"colorschemes" "colorschemes"
"gruvbox" "gruvbox"
optionName optionName
] "Please use `colorschemes.gruvbox.settings.${helpers.toSnakeCase optionName}` instead." ] "Please use `colorschemes.gruvbox.settings.${lib.nixvim.toSnakeCase optionName}` instead."
) )
[ [
"italics" "italics"

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
pkgs, pkgs,
config, config,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "kanagawa"; name = "kanagawa";
isColorscheme = true; isColorscheme = true;
originalName = "kanagawa.nvim"; originalName = "kanagawa.nvim";
@ -78,49 +80,49 @@ helpers.neovim-plugin.mkNeovimPlugin config {
]; ];
settingsOptions = { settingsOptions = {
compile = helpers.defaultNullOpts.mkBool false '' compile = defaultNullOpts.mkBool false ''
Enable compiling the colorscheme. Enable compiling the colorscheme.
''; '';
undercurl = helpers.defaultNullOpts.mkBool true '' undercurl = defaultNullOpts.mkBool true ''
Enable undercurls. Enable undercurls.
''; '';
commentStyle = helpers.defaultNullOpts.mkAttrsOf types.anything { italic = true; } '' commentStyle = defaultNullOpts.mkAttrsOf types.anything { italic = true; } ''
Highlight options for comments. Highlight options for comments.
''; '';
functionStyle = helpers.defaultNullOpts.mkAttrsOf types.anything { } '' functionStyle = defaultNullOpts.mkAttrsOf types.anything { } ''
Highlight options for functions. Highlight options for functions.
''; '';
keywordStyle = helpers.defaultNullOpts.mkAttrsOf types.anything { italic = true; } '' keywordStyle = defaultNullOpts.mkAttrsOf types.anything { italic = true; } ''
Highlight options for keywords. Highlight options for keywords.
''; '';
statementStyle = helpers.defaultNullOpts.mkAttrsOf types.anything { bold = true; } '' statementStyle = defaultNullOpts.mkAttrsOf types.anything { bold = true; } ''
Highlight options for statements. Highlight options for statements.
''; '';
typeStyle = helpers.defaultNullOpts.mkAttrsOf types.anything { } '' typeStyle = defaultNullOpts.mkAttrsOf types.anything { } ''
Highlight options for types. Highlight options for types.
''; '';
transparent = helpers.defaultNullOpts.mkBool false '' transparent = defaultNullOpts.mkBool false ''
Whether to set a background color. Whether to set a background color.
''; '';
dimInactive = helpers.defaultNullOpts.mkBool false '' dimInactive = defaultNullOpts.mkBool false ''
Whether dim inactive window `:h hl-NormalNC`. Whether dim inactive window `:h hl-NormalNC`.
''; '';
terminalColors = helpers.defaultNullOpts.mkBool true '' terminalColors = defaultNullOpts.mkBool true ''
If true, defines `vim.g.terminal_color_{0,17}`. If true, defines `vim.g.terminal_color_{0,17}`.
''; '';
colors = { colors = {
theme = theme =
helpers.defaultNullOpts.mkAttrsOf types.attrs defaultNullOpts.mkAttrsOf types.attrs
{ {
wave = { }; wave = { };
lotus = { }; lotus = { };
@ -154,7 +156,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
``` ```
''; '';
palette = helpers.defaultNullOpts.mkAttrsOf types.str { } '' palette = defaultNullOpts.mkAttrsOf types.str { } ''
Change all usages of these colors. Change all usages of these colors.
Example: Example:
@ -168,7 +170,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
}; };
overrides = overrides =
helpers.defaultNullOpts.mkLuaFn defaultNullOpts.mkLuaFn
'' ''
function(colors) function(colors)
return {} return {}
@ -198,16 +200,16 @@ helpers.neovim-plugin.mkNeovimPlugin config {
``` ```
''; '';
theme = helpers.defaultNullOpts.mkStr "wave" '' theme = defaultNullOpts.mkStr "wave" ''
The theme to load when background is not set. The theme to load when background is not set.
''; '';
background = { background = {
light = helpers.defaultNullOpts.mkStr "lotus" '' light = defaultNullOpts.mkStr "lotus" ''
The theme to use when `vim.o.background = "light"`. The theme to use when `vim.o.background = "light"`.
''; '';
dark = helpers.defaultNullOpts.mkStr "wave" '' dark = defaultNullOpts.mkStr "wave" ''
The theme to use when `vim.o.background = "dark"`. The theme to use when `vim.o.background = "dark"`.
''; '';
}; };

View file

@ -1,12 +1,11 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
helpers.vim-plugin.mkVimPlugin config { lib.nixvim.vim-plugin.mkVimPlugin config {
name = "melange"; name = "melange";
isColorscheme = true; isColorscheme = true;
originalName = "melange-nvim"; originalName = "melange-nvim";

View file

@ -1,22 +1,24 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "modus"; name = "modus";
luaName = "modus-themes"; luaName = "modus-themes";
originalName = "modus-themes.nvim"; originalName = "modus-themes.nvim";
defaultPackage = pkgs.vimPlugins.modus-themes-nvim; defaultPackage = pkgs.vimPlugins.modus-themes-nvim;
isColorscheme = true; isColorscheme = true;
maintainers = [ helpers.maintainers.nwjsmith ]; maintainers = [ lib.nixvim.maintainers.nwjsmith ];
settingsOptions = { settingsOptions = {
style = style =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"modus_operandi" "modus_operandi"
"modus_vivendi" "modus_vivendi"
@ -26,7 +28,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
''; '';
variant = variant =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"default" "default"
"tinted" "tinted"
@ -42,33 +44,33 @@ helpers.neovim-plugin.mkNeovimPlugin config {
- `tritanopia` is optimized for users with blue-yellow color deficiency. - `tritanopia` is optimized for users with blue-yellow color deficiency.
''; '';
transparent = helpers.defaultNullOpts.mkBool false '' transparent = defaultNullOpts.mkBool false ''
Disable setting the background color. Disable setting the background color.
''; '';
dim_inactive = helpers.defaultNullOpts.mkBool false '' dim_inactive = defaultNullOpts.mkBool false ''
Dims inactive windows. Dims inactive windows.
''; '';
styles = { styles = {
comments = helpers.defaultNullOpts.mkHighlight { italic = true; } "" '' comments = defaultNullOpts.mkHighlight { italic = true; } "" ''
Define comments highlight properties. Define comments highlight properties.
''; '';
keywords = helpers.defaultNullOpts.mkHighlight { italic = true; } "" '' keywords = defaultNullOpts.mkHighlight { italic = true; } "" ''
Define keywords highlight properties. Define keywords highlight properties.
''; '';
functions = helpers.defaultNullOpts.mkHighlight { } "" '' functions = defaultNullOpts.mkHighlight { } "" ''
Define functions highlight properties. Define functions highlight properties.
''; '';
variables = helpers.defaultNullOpts.mkHighlight { } "" '' variables = defaultNullOpts.mkHighlight { } "" ''
Define variables highlight properties. Define variables highlight properties.
''; '';
}; };
on_colors = helpers.defaultNullOpts.mkLuaFn "function(colors) end" '' on_colors = defaultNullOpts.mkLuaFn "function(colors) end" ''
Override specific color groups to use other groups or a hex color. Override specific color groups to use other groups or a hex color.
Function will be called with a `ColorScheme` table. Function will be called with a `ColorScheme` table.
@ -77,7 +79,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
``` ```
''; '';
on_highlights = helpers.defaultNullOpts.mkLuaFn "function(highlights, colors) end" '' on_highlights = defaultNullOpts.mkLuaFn "function(highlights, colors) end" ''
Override specific highlights to use other groups or a hex color. Override specific highlights to use other groups or a hex color.
Function will be called with a `Highlights` and `ColorScheme` table. Function will be called with a `Highlights` and `ColorScheme` table.

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
pkgs, pkgs,
config, config,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "nightfox"; name = "nightfox";
isColorscheme = true; isColorscheme = true;
originalName = "nightfox.nvim"; originalName = "nightfox.nvim";
@ -35,39 +37,37 @@ helpers.neovim-plugin.mkNeovimPlugin config {
settingsOptions = { settingsOptions = {
options = { options = {
compile_path = compile_path = defaultNullOpts.mkStr { __raw = "vim.fn.stdpath('cache') .. '/nightfox'"; } ''
helpers.defaultNullOpts.mkStr { __raw = "vim.fn.stdpath('cache') .. '/nightfox'"; }
''
The output directory path where the compiled results will be written to. The output directory path where the compiled results will be written to.
''; '';
compile_file_suffix = helpers.defaultNullOpts.mkStr "_compiled" '' compile_file_suffix = defaultNullOpts.mkStr "_compiled" ''
The string appended to the compiled file. The string appended to the compiled file.
Each `style` outputs to its own file. Each `style` outputs to its own file.
These files will append the suffix to the end of the file. These files will append the suffix to the end of the file.
''; '';
transparent = helpers.defaultNullOpts.mkBool false '' transparent = defaultNullOpts.mkBool false ''
A boolean value that if set will disable setting the background of `Normal`, `NormalNC` and A boolean value that if set will disable setting the background of `Normal`, `NormalNC` and
other highlight groups. other highlight groups.
This lets you use the colors of the colorscheme but use the background of your terminal. This lets you use the colors of the colorscheme but use the background of your terminal.
''; '';
terminal_colors = helpers.defaultNullOpts.mkBool true '' terminal_colors = defaultNullOpts.mkBool true ''
A boolean value that if set will define the terminal colors for the builtin `terminal` A boolean value that if set will define the terminal colors for the builtin `terminal`
(`vim.g.terminal_color_*`). (`vim.g.terminal_color_*`).
''; '';
dim_inactive = helpers.defaultNullOpts.mkBool false '' dim_inactive = defaultNullOpts.mkBool false ''
A boolean value that if set will set the background of Non current windows to be darker. A boolean value that if set will set the background of Non current windows to be darker.
See `:h hl-NormalNC`. See `:h hl-NormalNC`.
''; '';
module_default = helpers.defaultNullOpts.mkBool true '' module_default = defaultNullOpts.mkBool true ''
The default value of a module that has not been overridden in the modules table. The default value of a module that has not been overridden in the modules table.
''; '';
styles = helpers.defaultNullOpts.mkAttrsOf' { styles = defaultNullOpts.mkAttrsOf' {
type = types.str; type = types.str;
description = '' description = ''
A table that contains a list of syntax components and their corresponding style. A table that contains a list of syntax components and their corresponding style.
@ -106,7 +106,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
}; };
inverse = inverse =
helpers.defaultNullOpts.mkAttrsOf types.bool defaultNullOpts.mkAttrsOf types.bool
{ {
match_paren = false; match_paren = false;
visual = false; visual = false;
@ -123,11 +123,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
''; '';
colorblind = { colorblind = {
enable = helpers.defaultNullOpts.mkBool false '' enable = defaultNullOpts.mkBool false ''
Whether to enable nightfoxs _color vision deficiency_ (cdv) mode. Whether to enable nightfoxs _color vision deficiency_ (cdv) mode.
''; '';
simulate_only = helpers.defaultNullOpts.mkBool false '' simulate_only = defaultNullOpts.mkBool false ''
Only show simulated colorblind colors and not diff shifted. Only show simulated colorblind colors and not diff shifted.
''; '';
@ -135,7 +135,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
mapAttrs mapAttrs
( (
name: color: name: color:
helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0 '' defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0 ''
Severity [0, 1] for ${name} (${color}). Severity [0, 1] for ${name} (${color}).
'' ''
) )
@ -147,7 +147,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
}; };
modules = modules =
helpers.defaultNullOpts.mkAttrsOf types.anything defaultNullOpts.mkAttrsOf types.anything
{ {
coc = { coc = {
background = true; background = true;
@ -180,7 +180,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
}; };
palettes = palettes =
helpers.mkNullOrOption mkNullOrOption
( (
with types; with types;
attrsOf attrsOf
@ -230,7 +230,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
''; '';
specs = specs =
helpers.mkNullOrOption mkNullOrOption
( (
with types; with types;
attrsOf attrsOf
@ -274,7 +274,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
''; '';
groups = groups =
helpers.mkNullOrOption mkNullOrOption
( (
with types; with types;
attrsOf attrsOf

View file

@ -1,11 +1,13 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
helpers.vim-plugin.mkVimPlugin config { let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.vim-plugin.mkVimPlugin config {
name = "nord"; name = "nord";
isColorscheme = true; isColorscheme = true;
originalName = "nord.nvim"; originalName = "nord.nvim";
@ -27,31 +29,31 @@ helpers.vim-plugin.mkVimPlugin config {
]; ];
settingsOptions = { settingsOptions = {
contrast = helpers.defaultNullOpts.mkBool false '' contrast = defaultNullOpts.mkBool false ''
Make sidebars and popup menus like nvim-tree and telescope have a different background. Make sidebars and popup menus like nvim-tree and telescope have a different background.
''; '';
borders = helpers.defaultNullOpts.mkBool false '' borders = defaultNullOpts.mkBool false ''
Enable the border between vertically split windows. Enable the border between vertically split windows.
''; '';
disable_background = helpers.defaultNullOpts.mkBool false '' disable_background = defaultNullOpts.mkBool false ''
Disable the setting of background color so that NeoVim can use your terminal background. Disable the setting of background color so that NeoVim can use your terminal background.
''; '';
cursorline_transparent = helpers.defaultNullOpts.mkBool false '' cursorline_transparent = defaultNullOpts.mkBool false ''
Set the cursorline transparent/visible. Set the cursorline transparent/visible.
''; '';
enable_sidebar_background = helpers.defaultNullOpts.mkBool false '' enable_sidebar_background = defaultNullOpts.mkBool false ''
Re-enables the background of the sidebar if you disabled the background of everything. Re-enables the background of the sidebar if you disabled the background of everything.
''; '';
italic = helpers.defaultNullOpts.mkBool true '' italic = defaultNullOpts.mkBool true ''
Enables/disables italics. Enables/disables italics.
''; '';
uniform_diff_background = helpers.defaultNullOpts.mkBool false '' uniform_diff_background = defaultNullOpts.mkBool false ''
Enables/disables colorful backgrounds when used in _diff_ mode. Enables/disables colorful backgrounds when used in _diff_ mode.
''; '';
}; };

View file

@ -1,11 +1,10 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
helpers.vim-plugin.mkVimPlugin config { lib.nixvim.vim-plugin.mkVimPlugin config {
name = "one"; name = "one";
isColorscheme = true; isColorscheme = true;
originalName = "vim-one"; originalName = "vim-one";
@ -15,7 +14,7 @@ helpers.vim-plugin.mkVimPlugin config {
maintainers = [ lib.maintainers.GaetanLepage ]; maintainers = [ lib.maintainers.GaetanLepage ];
settingsOptions = { settingsOptions = {
allow_italics = helpers.defaultNullOpts.mkBool false '' allow_italics = lib.nixvim.defaultNullOpts.mkBool false ''
Whether to enable _italic_ (as long as your terminal supports it). Whether to enable _italic_ (as long as your terminal supports it).
''; '';
}; };

View file

@ -1,11 +1,10 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
helpers.neovim-plugin.mkNeovimPlugin config { lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "onedark"; name = "onedark";
isColorscheme = true; isColorscheme = true;
originalName = "onedark.nvim"; originalName = "onedark.nvim";
@ -39,7 +38,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
extraConfig = cfg: { extraConfig = cfg: {
extraConfigLuaPre = '' extraConfigLuaPre = ''
_onedark = require('onedark') _onedark = require('onedark')
_onedark.setup(${helpers.toLuaObject cfg.settings}) _onedark.setup(${lib.nixvim.toLuaObject cfg.settings})
_onedark.load() _onedark.load()
''; '';
}; };

View file

@ -1,11 +1,10 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
helpers.vim-plugin.mkVimPlugin config { lib.nixvim.vim-plugin.mkVimPlugin config {
name = "oxocarbon"; name = "oxocarbon";
isColorscheme = true; isColorscheme = true;
originalName = "oxocarbon.nvim"; originalName = "oxocarbon.nvim";

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "palette"; name = "palette";
isColorscheme = true; isColorscheme = true;
originalName = "palette.nvim"; originalName = "palette.nvim";
@ -34,15 +36,15 @@ helpers.neovim-plugin.mkNeovimPlugin config {
settingsOptions = { settingsOptions = {
palettes = { palettes = {
main = helpers.defaultNullOpts.mkStr "dark" '' main = defaultNullOpts.mkStr "dark" ''
Palette for the main colors. Palette for the main colors.
''; '';
accent = helpers.defaultNullOpts.mkStr "pastel" '' accent = defaultNullOpts.mkStr "pastel" ''
Palette for the accent colors. Palette for the accent colors.
''; '';
state = helpers.defaultNullOpts.mkStr "pastel" '' state = defaultNullOpts.mkStr "pastel" ''
Palette for the state colors. Palette for the state colors.
''; '';
}; };
@ -51,7 +53,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
mapAttrs mapAttrs
( (
name: colorNames: name: colorNames:
helpers.defaultNullOpts.mkAttrsOf defaultNullOpts.mkAttrsOf
(types.submodule { (types.submodule {
options = genAttrs colorNames ( options = genAttrs colorNames (
colorName: colorName:
@ -98,19 +100,19 @@ helpers.neovim-plugin.mkNeovimPlugin config {
]; ];
}; };
italics = helpers.defaultNullOpts.mkBool true '' italics = defaultNullOpts.mkBool true ''
Whether to use italics. Whether to use italics.
''; '';
transparent_background = helpers.defaultNullOpts.mkBool false '' transparent_background = defaultNullOpts.mkBool false ''
Whether to use transparent background. Whether to use transparent background.
''; '';
caching = helpers.defaultNullOpts.mkBool true '' caching = defaultNullOpts.mkBool true ''
Whether to enable caching. Whether to enable caching.
''; '';
cache_dir = helpers.defaultNullOpts.mkStr { cache_dir = defaultNullOpts.mkStr {
__raw = "vim.fn.stdpath('cache') .. '/palette'"; __raw = "vim.fn.stdpath('cache') .. '/palette'";
} "Cache directory."; } "Cache directory.";
}; };

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
pkgs, pkgs,
config, config,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "poimandres"; name = "poimandres";
isColorscheme = true; isColorscheme = true;
originalName = "poimandres.nvim"; originalName = "poimandres.nvim";
@ -28,37 +30,37 @@ helpers.neovim-plugin.mkNeovimPlugin config {
]; ];
settingsOptions = { settingsOptions = {
bold_vert_split = helpers.defaultNullOpts.mkBool false '' bold_vert_split = defaultNullOpts.mkBool false ''
Use bold vertical separators. Use bold vertical separators.
''; '';
dim_nc_background = helpers.defaultNullOpts.mkBool false '' dim_nc_background = defaultNullOpts.mkBool false ''
Dim 'non-current' window backgrounds. Dim 'non-current' window backgrounds.
''; '';
disable_background = helpers.defaultNullOpts.mkBool false '' disable_background = defaultNullOpts.mkBool false ''
Whether to disable the background. Whether to disable the background.
''; '';
disable_float_background = helpers.defaultNullOpts.mkBool false '' disable_float_background = defaultNullOpts.mkBool false ''
Whether to disable the background for floats. Whether to disable the background for floats.
''; '';
disable_italics = helpers.defaultNullOpts.mkBool false '' disable_italics = defaultNullOpts.mkBool false ''
Whether to disable italics. Whether to disable italics.
''; '';
dark_variant = helpers.defaultNullOpts.mkStr "main" '' dark_variant = defaultNullOpts.mkStr "main" ''
Dark variant. Dark variant.
''; '';
groups = helpers.mkNullOrOption (with types; attrsOf (either str (attrsOf str))) '' groups = mkNullOrOption (with 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 = helpers.defaultNullOpts.mkAttrsOf types.str { } '' highlight_groups = defaultNullOpts.mkAttrsOf types.str { } ''
Highlight groups. Highlight groups.
''; '';
}; };

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
pkgs, pkgs,
config, config,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts mkNullOrOption;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "rose-pine"; name = "rose-pine";
isColorscheme = true; isColorscheme = true;
defaultPackage = pkgs.vimPlugins.rose-pine; defaultPackage = pkgs.vimPlugins.rose-pine;
@ -61,7 +63,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
settingsOptions = { settingsOptions = {
variant = variant =
helpers.mkNullOrOption lib.nixvim.mkNullOrOption
(types.enum [ (types.enum [
"auto" "auto"
"main" "main"
@ -74,7 +76,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
''; '';
dark_variant = dark_variant =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"main" "main"
"moon" "moon"
@ -84,42 +86,42 @@ helpers.neovim-plugin.mkNeovimPlugin config {
Set the desired dark variant when `settings.variant` is set to "auto". Set the desired dark variant when `settings.variant` is set to "auto".
''; '';
dim_inactive_windows = helpers.defaultNullOpts.mkBool false '' dim_inactive_windows = defaultNullOpts.mkBool false ''
Differentiate between active and inactive windows and panels. Differentiate between active and inactive windows and panels.
''; '';
extend_background_behind_borders = helpers.defaultNullOpts.mkBool true '' extend_background_behind_borders = defaultNullOpts.mkBool true ''
Extend background behind borders. Extend background behind borders.
Appearance differs based on which border characters you are using. Appearance differs based on which border characters you are using.
''; '';
enable = { enable = {
legacy_highlights = helpers.defaultNullOpts.mkBool true "Enable legacy highlights."; legacy_highlights = defaultNullOpts.mkBool true "Enable legacy highlights.";
migrations = helpers.defaultNullOpts.mkBool true "Enable migrations."; migrations = defaultNullOpts.mkBool true "Enable migrations.";
terminal = helpers.defaultNullOpts.mkBool true "Enable terminal."; terminal = defaultNullOpts.mkBool true "Enable terminal.";
}; };
styles = { styles = {
bold = helpers.defaultNullOpts.mkBool true "Enable bold."; bold = defaultNullOpts.mkBool true "Enable bold.";
italic = helpers.defaultNullOpts.mkBool true "Enable italic."; italic = defaultNullOpts.mkBool true "Enable italic.";
transparency = helpers.defaultNullOpts.mkBool true "Enable transparency."; transparency = defaultNullOpts.mkBool true "Enable transparency.";
}; };
groups = helpers.mkNullOrOption (with types; attrsOf (either str (attrsOf str))) '' groups = mkNullOrOption (with 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 = helpers.defaultNullOpts.mkAttrsOf helpers.nixvimTypes.highlight { } '' highlight_groups = defaultNullOpts.mkAttrsOf types.highlight { } ''
Custom highlight groups. Custom highlight groups.
''; '';
before_highlight = helpers.defaultNullOpts.mkLuaFn "function(group, highlight, palette) end" '' before_highlight = defaultNullOpts.mkLuaFn "function(group, highlight, palette) end" ''
Called before each highlight group, before setting the highlight. Called before each highlight group, before setting the highlight.
`function(group, highlight, palette)` `function(group, highlight, palette)`

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
pkgs, pkgs,
config, config,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "tokyonight"; name = "tokyonight";
isColorscheme = true; isColorscheme = true;
originalName = "tokyonight.nvim"; originalName = "tokyonight.nvim";
@ -54,7 +56,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
settingsOptions = { settingsOptions = {
style = style =
helpers.defaultNullOpts.mkEnumFirstDefault defaultNullOpts.mkEnumFirstDefault
[ [
"storm" "storm"
"night" "night"
@ -64,15 +66,15 @@ helpers.neovim-plugin.mkNeovimPlugin config {
The theme comes in three styles, `storm`, a darker variant `night` and `day`. The theme comes in three styles, `storm`, a darker variant `night` and `day`.
''; '';
light_style = helpers.defaultNullOpts.mkStr "day" '' light_style = defaultNullOpts.mkStr "day" ''
The theme to use when the background is set to `light`. The theme to use when the background is set to `light`.
''; '';
transparent = helpers.defaultNullOpts.mkBool false '' transparent = defaultNullOpts.mkBool false ''
Disable setting the background color. Disable setting the background color.
''; '';
terminal_colors = helpers.defaultNullOpts.mkBool true '' terminal_colors = defaultNullOpts.mkBool true ''
Configure the colors used when opening a :terminal in Neovim Configure the colors used when opening a :terminal in Neovim
''; '';
@ -80,26 +82,26 @@ helpers.neovim-plugin.mkNeovimPlugin config {
let let
mkBackgroundStyle = mkBackgroundStyle =
name: name:
helpers.defaultNullOpts.mkEnumFirstDefault [ defaultNullOpts.mkEnumFirstDefault [
"dark" "dark"
"transparent" "transparent"
"normal" "normal"
] "Background style for ${name}"; ] "Background style for ${name}";
in in
{ {
comments = helpers.defaultNullOpts.mkHighlight { italic = true; } "" '' comments = defaultNullOpts.mkHighlight { italic = true; } "" ''
Define comments highlight properties. Define comments highlight properties.
''; '';
keywords = helpers.defaultNullOpts.mkHighlight { italic = true; } "" '' keywords = defaultNullOpts.mkHighlight { italic = true; } "" ''
Define keywords highlight properties. Define keywords highlight properties.
''; '';
functions = helpers.defaultNullOpts.mkHighlight { } "" '' functions = defaultNullOpts.mkHighlight { } "" ''
Define functions highlight properties. Define functions highlight properties.
''; '';
variables = helpers.defaultNullOpts.mkHighlight { } "" '' variables = defaultNullOpts.mkHighlight { } "" ''
Define variables highlight properties. Define variables highlight properties.
''; '';
@ -109,7 +111,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
}; };
sidebars = sidebars =
helpers.defaultNullOpts.mkListOf types.str defaultNullOpts.mkListOf types.str
[ [
"qf" "qf"
"help" "help"
@ -118,31 +120,31 @@ helpers.neovim-plugin.mkNeovimPlugin config {
Set a darker background on sidebar-like windows. Set a darker background on sidebar-like windows.
''; '';
day_brightness = helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) 0.3 '' day_brightness = defaultNullOpts.mkNullable (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.
''; '';
hide_inactive_statusline = helpers.defaultNullOpts.mkBool false '' hide_inactive_statusline = defaultNullOpts.mkBool false ''
Enabling this option will hide inactive statuslines and replace them with a thin border instead. Enabling this option will hide inactive statuslines and replace them with a thin border instead.
Should work with the standard **StatusLine** and **LuaLine**. Should work with the standard **StatusLine** and **LuaLine**.
''; '';
dim_inactive = helpers.defaultNullOpts.mkBool false '' dim_inactive = defaultNullOpts.mkBool false ''
Dims inactive windows. Dims inactive windows.
''; '';
lualine_bold = helpers.defaultNullOpts.mkBool false '' lualine_bold = defaultNullOpts.mkBool false ''
When true, section headers in the lualine theme will be bold. When true, section headers in the lualine theme will be bold.
''; '';
on_colors = helpers.defaultNullOpts.mkLuaFn "function(colors) end" '' on_colors = defaultNullOpts.mkLuaFn "function(colors) end" ''
Override specific color groups to use other groups or a hex color. Override specific color groups to use other groups or a hex color.
Function will be called with a `ColorScheme` table. Function will be called with a `ColorScheme` table.
`@param colors ColorScheme` `@param colors ColorScheme`
''; '';
on_highlights = helpers.defaultNullOpts.mkLuaFn "function(highlights, colors) end" '' on_highlights = defaultNullOpts.mkLuaFn "function(highlights, colors) end" ''
Override specific highlights to use other groups or a hex color. Override specific highlights to use other groups or a hex color.
Function will be called with a `Highlights` and `ColorScheme` table. Function will be called with a `Highlights` and `ColorScheme` table.
`@param highlights Highlights` `@param highlights Highlights`

View file

@ -1,12 +1,14 @@
{ {
lib, lib,
helpers,
config, config,
pkgs, pkgs,
... ...
}: }:
with lib; with lib;
helpers.neovim-plugin.mkNeovimPlugin config { let
inherit (lib.nixvim) defaultNullOpts toLuaObject;
in
lib.nixvim.neovim-plugin.mkNeovimPlugin config {
name = "vscode"; name = "vscode";
isColorscheme = true; isColorscheme = true;
originalName = "vscode-nvim"; originalName = "vscode-nvim";
@ -17,17 +19,15 @@ helpers.neovim-plugin.mkNeovimPlugin config {
maintainers = [ maintainers.loicreynier ]; maintainers = [ maintainers.loicreynier ];
settingsOptions = { settingsOptions = {
transparent = helpers.defaultNullOpts.mkBool false "Whether to enable transparent background"; transparent = defaultNullOpts.mkBool false "Whether to enable transparent background";
italic_comments = helpers.defaultNullOpts.mkBool false "Whether to enable italic comments"; italic_comments = defaultNullOpts.mkBool false "Whether to enable italic comments";
underline_links = helpers.defaultNullOpts.mkBool false "Whether to underline links"; underline_links = defaultNullOpts.mkBool false "Whether to underline links";
disable_nvimtree_bg = helpers.defaultNullOpts.mkBool true "Whether to disable nvim-tree background"; disable_nvimtree_bg = defaultNullOpts.mkBool true "Whether to disable nvim-tree background";
color_overrides = helpers.defaultNullOpts.mkAttrsOf types.str { } '' color_overrides = defaultNullOpts.mkAttrsOf 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 = group_overrides = defaultNullOpts.mkAttrsOf types.highlight { } ''
with helpers;
defaultNullOpts.mkAttrsOf nixvimTypes.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.
''; '';
@ -36,7 +36,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
extraConfig = cfg: { extraConfig = cfg: {
extraConfigLuaPre = '' extraConfigLuaPre = ''
local _vscode = require("vscode") local _vscode = require("vscode")
_vscode.setup(${helpers.toLuaObject cfg.settings}) _vscode.setup(${toLuaObject cfg.settings})
_vscode.load() _vscode.load()
''; '';
}; };