nix-community.nixvim/plugins/colorschemes/tokyonight.nix

59 lines
2.4 KiB
Nix
Raw Normal View History

2021-11-02 12:00:14 +01:00
{ pkgs, config, lib, ... }:
with lib;
2021-11-02 13:50:16 +01:00
let
cfg = config.colorschemes.tokyonight;
2021-11-02 13:50:16 +01:00
style = types.enum [ "storm" "night" "day" ];
in
{
2021-11-02 12:00:14 +01:00
options = {
colorschemes.tokyonight = {
2021-11-02 12:00:14 +01:00
enable = mkEnableOption "Enable tokyonight";
2021-11-02 13:50:16 +01:00
style = mkOption {
type = types.nullOr style;
default = null;
description = "Theme style";
};
terminalColors = mkEnableOption
"Configure the colors used when opening a :terminal in Neovim";
italicComments = mkEnableOption "Make comments italic";
2021-11-03 08:47:45 +01:00
italicKeywords = mkEnableOption "Make keywords italic";
2021-11-02 13:50:16 +01:00
italicFunctions = mkEnableOption "Make functions italic";
italicVariables = mkEnableOption "Make variables and identifiers italic";
transparent =
mkEnableOption "Enable this to disable setting the background color";
hideInactiveStatusline = mkEnableOption
"Enabling this option will hide inactive statuslines and replace them with a thin border";
transparentSidebar = mkEnableOption
"Sidebar like windows like NvimTree get a transparent background";
darkSidebar = mkEnableOption
"Sidebar like windows like NvimTree get a darker background";
darkFloat = mkEnableOption
"Float windows like the lsp diagnostics windows get a darker background";
lualineBold = mkEnableOption
"When true, section headers in the lualine theme will be bold";
2021-11-02 12:00:14 +01:00
};
};
config = mkIf cfg.enable {
colorscheme = "tokyonight";
extraPlugins = [ pkgs.vimPlugins.tokyonight-nvim ];
options = { termguicolors = true; };
globals = {
tokyonight_style = mkIf (!isNull cfg.style) cfg.style;
tokyonight_terminal_colors = mkIf (!cfg.terminalColors) 0;
2021-11-02 13:50:16 +01:00
tokyonight_italic_comments = mkIf (!cfg.italicComments) 0;
tokyonight_italic_keywords = mkIf (!cfg.italicKeywords) 0;
tokyonight_italic_functions = mkIf (cfg.italicFunctions) 1;
tokyonight_italic_variables = mkIf (cfg.italicVariables) 1;
2021-11-02 13:50:16 +01:00
tokyonight_transparent = mkIf (cfg.transparent) 1;
tokyonight_hide_inactive_statusline =
mkIf (cfg.hideInactiveStatusline) 1;
tokyonight_transparent_sidebar = mkIf (cfg.transparentSidebar) 1;
tokyonight_dark_sidebar = mkIf (!cfg.darkSidebar) 0;
tokyonight_dark_float = mkIf (!cfg.darkFloat) 0;
tokyonight_lualine_bold = mkIf (cfg.lualineBold) 1;
2021-11-02 12:00:14 +01:00
};
};
}