system/modules/home-manager/programs/terminals/wezterm.nix

71 lines
2.2 KiB
Nix
Raw Permalink Normal View History

{ lib, config, ... }:
let
2024-04-16 02:51:46 +03:00
cfg = config.local.programs.terminals.wezterm;
themeCfg = config.local.themes."${config.local.theme.name}";
in
{
2024-04-16 02:51:46 +03:00
options.local.programs.terminals.wezterm = with lib; {
enable = mkEnableOption "wezterm";
fontSize = mkOption {
type = types.number;
default = 11.0;
description = "Wezterm font size";
};
};
2024-04-16 02:51:46 +03:00
config = lib.mkIf cfg.enable {
programs.wezterm = {
enable = true;
colorSchemes = {
myCoolTheme = {
ansi = [
themeCfg.window.regular.color0
themeCfg.window.regular.color1
themeCfg.window.regular.color2
themeCfg.window.regular.color3
themeCfg.window.regular.color4
themeCfg.window.regular.color5
themeCfg.window.regular.color6
themeCfg.window.regular.color7
];
brights = [
themeCfg.window.bold.color8
themeCfg.window.bold.color9
themeCfg.window.bold.color10
themeCfg.window.bold.color11
themeCfg.window.bold.color12
themeCfg.window.bold.color13
themeCfg.window.bold.color14
themeCfg.window.bold.color15
];
indexed = {
"16" = themeCfg.window.extended.color16;
"17" = themeCfg.window.extended.color17;
"18" = themeCfg.window.extended.color18;
"19" = themeCfg.window.extended.color19;
};
background = themeCfg.window.background;
foreground = themeCfg.window.mainText;
cursor_bg = themeCfg.window.cursor;
cursor_border = themeCfg.window.cursor;
cursor_fg = themeCfg.window.cursorText;
selection_bg = themeCfg.window.selection;
selection_fg = themeCfg.window.selectionText;
};
};
extraConfig = ''
return {
font = wezterm.font("monospace"),
font_size = ${toString cfg.fontSize},
color_scheme = "myCoolTheme",
hide_tab_bar_if_only_one_tab = true,
2024-04-23 11:51:15 +03:00
-- https://github.com/wez/wezterm/issues/4483
enable_wayland = false,
warn_about_missing_glyphs = false
}
'';
};
};
}