2023-02-01 17:17:27 +01:00
|
|
|
{ pkgs
|
|
|
|
, config
|
|
|
|
, lib
|
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
with lib; let
|
2022-09-18 11:19:23 +01:00
|
|
|
cfg = config.colorschemes.tokyonight;
|
2023-02-01 17:17:27 +01:00
|
|
|
helpers = import ../helpers.nix args;
|
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 19:46:49 +01:00
|
|
|
package = helpers.mkPackageOption "tokyonight" pkgs.vimPlugins.tokyonight-nvim;
|
2023-02-01 17:17:27 +01:00
|
|
|
style = helpers.defaultNullOpts.mkEnumFirstDefault [ "storm" "night" "day" ] "Theme style";
|
|
|
|
terminalColors =
|
|
|
|
helpers.defaultNullOpts.mkBool true
|
|
|
|
"Configure the colors used when opening a :terminal in Neovim";
|
|
|
|
transparent = helpers.defaultNullOpts.mkBool false "disable setting the background color";
|
2022-12-24 01:08:54 +01:00
|
|
|
styles =
|
|
|
|
let
|
2023-02-01 17:17:27 +01:00
|
|
|
mkBackgroundStyle = name:
|
|
|
|
helpers.defaultNullOpts.mkEnumFirstDefault [ "dark" "transparent" "normal" ]
|
|
|
|
"Background style for ${name}";
|
2022-12-24 01:08:54 +01:00
|
|
|
in
|
|
|
|
{
|
2023-02-01 17:17:27 +01:00
|
|
|
comments =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{italic = true;}"
|
|
|
|
"Define comments highlight properties";
|
|
|
|
keywords =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{italic = true;}"
|
|
|
|
"Define keywords highlight properties";
|
|
|
|
functions =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}"
|
|
|
|
"Define functions highlight properties";
|
|
|
|
variables =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}"
|
|
|
|
"Define variables highlight properties";
|
2022-12-24 01:08:54 +01:00
|
|
|
sidebars = mkBackgroundStyle "sidebars";
|
|
|
|
floats = mkBackgroundStyle "floats";
|
|
|
|
};
|
2023-02-01 17:17:27 +01:00
|
|
|
sidebars =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''["qf" "help"]''
|
|
|
|
"Set a darker background on sidebar-like windows";
|
|
|
|
dayBrightness =
|
|
|
|
helpers.defaultNullOpts.mkNullable (types.numbers.between 0.0 1.0) "0.3"
|
|
|
|
"Adjusts the brightness of the colors of the **Day** style";
|
2022-12-24 01:08:54 +01:00
|
|
|
hideInactiveStatusline =
|
2023-02-01 17:17:27 +01:00
|
|
|
helpers.defaultNullOpts.mkBool false
|
2022-12-24 01:08:54 +01:00
|
|
|
"Enabling this option will hide inactive statuslines and replace them with a thin border";
|
2023-02-01 17:17:27 +01:00
|
|
|
dimInactive = helpers.defaultNullOpts.mkBool false "dims inactive windows";
|
2022-12-24 01:08:54 +01:00
|
|
|
lualineBold =
|
2023-02-01 17:17:27 +01:00
|
|
|
helpers.defaultNullOpts.mkBool false
|
2022-12-24 01:08:54 +01:00
|
|
|
"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
|
|
|
};
|
|
|
|
}
|