2024-05-23 13:51:05 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
}: let
|
|
|
|
inherit (lib.strings) optionalString;
|
2024-10-07 08:47:17 +00:00
|
|
|
inherit (lib.attrsets) listToAttrs;
|
2024-10-06 23:22:41 +00:00
|
|
|
inherit (lib.options) mkOption mkEnableOption;
|
|
|
|
inherit (lib.types) bool str;
|
2024-10-07 08:47:17 +00:00
|
|
|
inherit (lib.nvim.types) hexColor mkPluginSetupOption;
|
2024-10-06 22:02:51 +00:00
|
|
|
cfg = config.vim.theme;
|
2024-10-06 23:22:41 +00:00
|
|
|
|
|
|
|
mkEnableOption' = name: mkEnableOption name // {default = true;};
|
2024-10-07 08:47:17 +00:00
|
|
|
|
|
|
|
numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "A" "B" "C" "D" "E" "F"];
|
|
|
|
base16Options = listToAttrs (map (n: {
|
|
|
|
name = "base0${n}";
|
|
|
|
value = mkOption {
|
|
|
|
description = "The base0${n} color to use";
|
|
|
|
type = hexColor;
|
|
|
|
default = cfg.base16-colors."base0${n}";
|
|
|
|
};
|
|
|
|
})
|
|
|
|
numbers);
|
2024-05-23 13:51:05 +00:00
|
|
|
in {
|
2024-10-05 13:47:33 +00:00
|
|
|
base16 = {
|
2024-10-07 08:47:17 +00:00
|
|
|
setupOpts = mkPluginSetupOption "base16" base16Options;
|
|
|
|
setup = "";
|
2024-10-05 13:47:33 +00:00
|
|
|
};
|
2024-10-07 08:47:17 +00:00
|
|
|
|
2023-02-01 19:11:37 +00:00
|
|
|
onedark = {
|
2024-10-06 23:22:41 +00:00
|
|
|
setupOpts = mkPluginSetupOption "onedark" {
|
|
|
|
style = mkOption {
|
|
|
|
type = str;
|
2024-10-07 08:47:17 +00:00
|
|
|
default = cfg.style;
|
2024-10-06 23:22:41 +00:00
|
|
|
internal = true;
|
|
|
|
};
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
2024-10-06 23:22:41 +00:00
|
|
|
setup = ''
|
2023-02-01 19:11:37 +00:00
|
|
|
-- OneDark theme
|
2024-10-06 22:02:51 +00:00
|
|
|
require('onedark').load()
|
2023-02-01 19:11:37 +00:00
|
|
|
'';
|
2023-02-01 21:00:48 +00:00
|
|
|
styles = ["dark" "darker" "cool" "deep" "warm" "warmer"];
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
tokyonight = {
|
2024-10-06 23:22:41 +00:00
|
|
|
setupOpts = mkPluginSetupOption "tokyonight" {
|
|
|
|
transparent = mkOption {
|
|
|
|
type = bool;
|
|
|
|
default = cfg.transparent;
|
|
|
|
internal = true;
|
|
|
|
};
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
2024-10-06 23:22:41 +00:00
|
|
|
setup = ''
|
2024-10-07 08:47:17 +00:00
|
|
|
vim.cmd[[colorscheme tokyonight-${cfg.style}]]
|
2023-02-01 19:11:37 +00:00
|
|
|
'';
|
2024-10-07 08:47:17 +00:00
|
|
|
styles = ["night" "day" "storm" "moon"];
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
|
|
|
|
2023-04-17 23:01:51 +00:00
|
|
|
dracula = {
|
2024-10-06 23:22:41 +00:00
|
|
|
setupOpts = mkPluginSetupOption "dracula" {
|
|
|
|
transparent_bg = mkOption {
|
|
|
|
type = bool;
|
|
|
|
default = cfg.transparent;
|
|
|
|
internal = true;
|
|
|
|
};
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
2024-10-06 23:22:41 +00:00
|
|
|
setup = ''
|
2023-04-17 23:01:51 +00:00
|
|
|
require('dracula').load();
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-02-01 19:11:37 +00:00
|
|
|
catppuccin = {
|
2024-10-06 23:22:41 +00:00
|
|
|
setupOpts = mkPluginSetupOption "catppuccin" {
|
|
|
|
flavour = mkOption {
|
|
|
|
type = str;
|
2024-10-07 08:47:17 +00:00
|
|
|
default = cfg.style;
|
|
|
|
# internal = true;
|
2024-10-06 23:22:41 +00:00
|
|
|
};
|
|
|
|
transparent_background = mkOption {
|
|
|
|
type = bool;
|
2024-10-07 08:47:17 +00:00
|
|
|
default = cfg.transparent;
|
2024-10-06 23:22:41 +00:00
|
|
|
internal = true;
|
|
|
|
};
|
|
|
|
term_colors = mkEnableOption' "term_colors";
|
2024-10-06 22:02:51 +00:00
|
|
|
integrations = {
|
|
|
|
nvimtree = {
|
2024-10-06 23:22:41 +00:00
|
|
|
enabled = mkEnableOption' "enabled";
|
|
|
|
transparent_panel = mkOption {
|
|
|
|
type = bool;
|
2024-10-07 08:47:17 +00:00
|
|
|
default = cfg.transparent;
|
2024-10-06 23:22:41 +00:00
|
|
|
};
|
|
|
|
show_root = mkEnableOption' "show_root";
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
2023-02-01 21:00:48 +00:00
|
|
|
|
2024-10-06 23:22:41 +00:00
|
|
|
hop = mkEnableOption' "hop";
|
|
|
|
gitsigns = mkEnableOption' "gitsigns";
|
|
|
|
telescope = mkEnableOption' "telescope";
|
|
|
|
treesitter = mkEnableOption' "treesitter";
|
|
|
|
treesitter_context = mkEnableOption' "treesitter_context";
|
|
|
|
ts_rainbow = mkEnableOption' "ts_rainbow";
|
|
|
|
fidget = mkEnableOption' "fidget";
|
|
|
|
alpha = mkEnableOption' "alpha";
|
|
|
|
leap = mkEnableOption' "leap";
|
|
|
|
markdown = mkEnableOption' "markdown";
|
|
|
|
noice = mkEnableOption' "noice";
|
2024-10-06 22:02:51 +00:00
|
|
|
# nvim-notify
|
2024-10-06 23:22:41 +00:00
|
|
|
notify = mkEnableOption' "notify";
|
|
|
|
which_key = mkEnableOption' "which_key";
|
2024-10-07 08:47:17 +00:00
|
|
|
navic = {
|
2024-10-06 23:22:41 +00:00
|
|
|
enabled = mkEnableOption' "enabled";
|
2024-10-06 22:02:51 +00:00
|
|
|
# lualine will set backgound to mantle
|
2024-10-06 23:22:41 +00:00
|
|
|
custom_bg = mkOption {
|
|
|
|
type = str;
|
|
|
|
default = "NONE";
|
|
|
|
};
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-10-07 08:47:17 +00:00
|
|
|
setup = ''
|
2024-10-06 22:02:51 +00:00
|
|
|
-- Catppuccin theme
|
2023-02-01 19:11:37 +00:00
|
|
|
-- setup must be called before loading
|
|
|
|
vim.cmd.colorscheme "catppuccin"
|
|
|
|
'';
|
2024-10-07 08:47:17 +00:00
|
|
|
styles = ["mocha" "latte" "frappe" "macchiato"];
|
2023-02-01 19:11:37 +00:00
|
|
|
};
|
2023-10-20 22:19:29 +00:00
|
|
|
|
|
|
|
oxocarbon = {
|
2024-10-06 23:22:41 +00:00
|
|
|
setupOpts = mkPluginSetupOption "oxocarbon" {};
|
|
|
|
setup = ''
|
2024-05-23 13:51:05 +00:00
|
|
|
require('oxocarbon')
|
2024-10-07 08:47:17 +00:00
|
|
|
vim.opt.background = "${cfg.style}"
|
2024-05-23 13:51:05 +00:00
|
|
|
vim.cmd.colorscheme = "oxocarbon"
|
2024-10-06 22:02:51 +00:00
|
|
|
${optionalString cfg.transparent ''
|
2024-05-23 13:51:05 +00:00
|
|
|
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
|
|
|
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
|
|
|
vim.api.nvim_set_hl(0, "LineNr", { bg = "none" })
|
|
|
|
vim.api.nvim_set_hl(0, "SignColumn", { bg = "none" })
|
2024-05-25 17:37:51 +00:00
|
|
|
${optionalString config.vim.filetree.nvimTree.enable ''
|
2024-05-23 13:51:05 +00:00
|
|
|
vim.api.nvim_set_hl(0, "NvimTreeNormal", { bg = "none" })
|
|
|
|
''}
|
|
|
|
''}
|
2023-10-20 22:19:29 +00:00
|
|
|
'';
|
|
|
|
styles = ["dark" "light"];
|
|
|
|
};
|
2024-01-17 20:08:36 +00:00
|
|
|
|
|
|
|
gruvbox = {
|
2024-10-06 23:22:41 +00:00
|
|
|
setupOpts = mkPluginSetupOption "gruvbox" {
|
2024-10-07 08:47:17 +00:00
|
|
|
transparent_mode = mkOption {
|
|
|
|
type = bool;
|
|
|
|
default = cfg.transparent;
|
|
|
|
internal = true;
|
|
|
|
};
|
|
|
|
# transparent_mode = cfg.transparent;
|
2024-10-06 22:02:51 +00:00
|
|
|
# add neovim terminal colors
|
2024-10-06 23:22:41 +00:00
|
|
|
terminal_colors = mkEnableOption' "terminal_colors";
|
|
|
|
undercurl = mkEnableOption' "undercurls";
|
|
|
|
underline = mkEnableOption' "underline";
|
|
|
|
bold = mkEnableOption' "bold";
|
2024-10-06 22:02:51 +00:00
|
|
|
italic = {
|
2024-10-06 23:22:41 +00:00
|
|
|
strings = mkEnableOption' "strings";
|
|
|
|
emphasis = mkEnableOption' "emphasis";
|
|
|
|
comments = mkEnableOption' "comments";
|
|
|
|
operators = mkEnableOption "operators";
|
|
|
|
folds = mkEnableOption' "folds";
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
2024-10-06 23:22:41 +00:00
|
|
|
strikethrough = mkEnableOption' "strikethrough";
|
|
|
|
invert_selection = mkEnableOption "invert_selection";
|
|
|
|
invert_signs = mkEnableOption "invert_signs";
|
|
|
|
invert_tabline = mkEnableOption "invert_tabline";
|
|
|
|
invert_intend_guides = mkEnableOption "invert_intend_guides";
|
|
|
|
inverse = mkEnableOption' "inverse";
|
2024-10-07 08:47:17 +00:00
|
|
|
contrast = mkOption {
|
|
|
|
type = str;
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
# TODO: fix these
|
|
|
|
# palette_overrides = mkOption{};
|
|
|
|
# overrides = {};
|
2024-10-06 23:22:41 +00:00
|
|
|
dim_inactive = mkEnableOption "dim_inactive";
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
2024-10-06 23:22:41 +00:00
|
|
|
setup = ''
|
2024-01-17 20:08:36 +00:00
|
|
|
-- Gruvbox theme
|
2024-10-07 08:47:17 +00:00
|
|
|
vim.o.background = "${cfg.style}"
|
2024-01-17 20:08:36 +00:00
|
|
|
vim.cmd("colorscheme gruvbox")
|
|
|
|
'';
|
|
|
|
styles = ["dark" "light"];
|
|
|
|
};
|
2024-02-13 20:41:13 +00:00
|
|
|
rose-pine = {
|
2024-10-06 23:22:41 +00:00
|
|
|
setupOpts = mkPluginSetupOption "rose-pine" {
|
|
|
|
dark_variant = mkOption {
|
|
|
|
type = str;
|
2024-10-07 08:47:17 +00:00
|
|
|
default = cfg.style;
|
2024-10-06 23:22:41 +00:00
|
|
|
internal = true;
|
|
|
|
};
|
|
|
|
dim_inactive_windows = mkEnableOption "dim_inactive_windows";
|
|
|
|
extend_background_behind_borders = mkEnableOption' "extend_background_behind_borders";
|
2024-02-13 20:41:13 +00:00
|
|
|
|
2024-10-06 22:02:51 +00:00
|
|
|
enable = {
|
2024-10-06 23:22:41 +00:00
|
|
|
terminal = mkEnableOption' "terminal";
|
|
|
|
migrations = mkEnableOption' "migrations";
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
2024-02-13 20:41:13 +00:00
|
|
|
|
2024-10-06 22:02:51 +00:00
|
|
|
styles = {
|
2024-10-06 23:22:41 +00:00
|
|
|
bold = mkEnableOption "bold";
|
2024-10-06 22:02:51 +00:00
|
|
|
# I would like to add more options for this
|
2024-10-06 23:22:41 +00:00
|
|
|
italic = mkEnableOption "italic";
|
|
|
|
transparency = mkOption {
|
|
|
|
type = bool;
|
|
|
|
default = cfg.transparent;
|
|
|
|
internal = true;
|
|
|
|
};
|
2024-10-06 22:02:51 +00:00
|
|
|
};
|
|
|
|
};
|
2024-02-13 20:41:13 +00:00
|
|
|
|
2024-10-06 23:22:41 +00:00
|
|
|
setup = ''
|
2024-02-13 20:41:13 +00:00
|
|
|
vim.cmd("colorscheme rose-pine")
|
|
|
|
'';
|
|
|
|
styles = ["main" "moon" "dawn"];
|
|
|
|
};
|
2023-02-01 19:11:37 +00:00
|
|
|
}
|