2022-12-29 17:34:47 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
2021-11-02 12:00:14 +01:00
|
|
|
with lib;
|
2021-11-02 13:50:16 +01:00
|
|
|
let
|
2022-09-18 11:19:23 +01:00
|
|
|
cfg = config.colorschemes.tokyonight;
|
2021-11-02 13:50:16 +01:00
|
|
|
style = types.enum [ "storm" "night" "day" ];
|
2022-12-29 17:34:47 +00:00
|
|
|
helpers = import ../helpers.nix { inherit lib; };
|
2022-09-18 11:19:23 +01:00
|
|
|
in
|
|
|
|
{
|
2021-11-02 12:00:14 +01:00
|
|
|
options = {
|
2022-09-18 11:19:23 +01:00
|
|
|
colorschemes.tokyonight = {
|
2023-01-22 03:32:08 +00:00
|
|
|
enable = mkEnableOption "tokyonight";
|
2023-01-25 00:03:26 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.vimPlugins.tokyonight-nvim;
|
|
|
|
description = "Plugin to use for tokyonight";
|
|
|
|
};
|
2021-11-02 13:50:16 +01:00
|
|
|
style = mkOption {
|
2022-12-24 01:08:54 +01:00
|
|
|
type = style;
|
|
|
|
default = "storm";
|
2021-11-02 13:50:16 +01:00
|
|
|
description = "Theme style";
|
|
|
|
};
|
2022-12-24 01:08:54 +01:00
|
|
|
terminalColors = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Configure the colors used when opening a :terminal in Neovim";
|
|
|
|
};
|
2023-01-22 03:32:08 +00:00
|
|
|
transparent = mkEnableOption "disable setting the background color";
|
2022-12-24 01:08:54 +01:00
|
|
|
styles =
|
|
|
|
let
|
|
|
|
mkBackgroundStyle = name: mkOption {
|
|
|
|
type = types.enum [ "dark" "transparent" "normal" ];
|
|
|
|
description = "Background style for ${name}";
|
|
|
|
default = "dark";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
comments = mkOption {
|
|
|
|
type = types.attrsOf types.anything;
|
|
|
|
description = "Define comments highlight properties";
|
|
|
|
default = { italic = true; };
|
|
|
|
};
|
|
|
|
keywords = mkOption {
|
|
|
|
type = types.attrsOf types.anything;
|
|
|
|
description = "Define keywords highlight properties";
|
|
|
|
default = { italic = true; };
|
|
|
|
};
|
|
|
|
functions = mkOption {
|
|
|
|
type = types.attrsOf types.anything;
|
|
|
|
description = "Define functions highlight properties";
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
variables = mkOption {
|
|
|
|
type = types.attrsOf types.anything;
|
|
|
|
description = "Define variables highlight properties";
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
sidebars = mkBackgroundStyle "sidebars";
|
|
|
|
floats = mkBackgroundStyle "floats";
|
|
|
|
};
|
|
|
|
sidebars = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [ "qf" "help" ];
|
|
|
|
description = "Set a darker background on sidebar-like windows";
|
|
|
|
example = ''["qf" "vista_kind" "terminal" "packer"]'';
|
|
|
|
};
|
|
|
|
dayBrightness = mkOption {
|
|
|
|
type = types.numbers.between 0.0 1.0;
|
|
|
|
default = 0.3;
|
|
|
|
description = "Adjusts the brightness of the colors of the **Day** style";
|
|
|
|
};
|
|
|
|
hideInactiveStatusline =
|
|
|
|
mkEnableOption
|
|
|
|
"Enabling this option will hide inactive statuslines and replace them with a thin border";
|
|
|
|
dimInactive = mkEnableOption "dims inactive windows";
|
|
|
|
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 {
|
2022-09-18 11:19:23 +01:00
|
|
|
colorscheme = "tokyonight";
|
2023-01-19 10:45:15 +00:00
|
|
|
extraPlugins = [ cfg.package ];
|
2022-09-18 11:19:23 +01:00
|
|
|
options = { termguicolors = true; };
|
2022-12-24 01:08:54 +01:00
|
|
|
extraConfigLuaPre =
|
|
|
|
let
|
|
|
|
setupOptions = with cfg; {
|
|
|
|
inherit (cfg) style transparent styles sidebars;
|
|
|
|
terminal_colors = terminalColors;
|
|
|
|
hide_inactive_statusline = hideInactiveStatusline;
|
|
|
|
dim_inactive = dimInactive;
|
|
|
|
lualine_bold = lualineBold;
|
|
|
|
day_brightness = dayBrightness;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
''
|
|
|
|
require("tokyonight").setup(${helpers.toLuaObject setupOptions})
|
|
|
|
'';
|
2021-11-02 12:00:14 +01:00
|
|
|
};
|
|
|
|
}
|