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

152 lines
4.3 KiB
Nix
Raw Permalink Normal View History

2024-04-16 02:51:46 +03:00
{ lib, config, ... }:
2022-10-12 01:41:32 +03:00
let
2024-04-16 02:51:46 +03:00
cfg = config.local.programs.terminals.alacritty;
themeCfg = config.local.themes."${config.local.theme.name}";
2022-10-12 01:41:32 +03:00
in
{
2024-04-16 02:51:46 +03:00
options.local.programs.terminals.alacritty = with lib; {
enable = mkEnableOption "alacritty";
2022-10-12 01:41:32 +03:00
fontSize = mkOption {
type = types.number;
default = 11.0;
description = "Alacritty font size";
};
};
2024-04-16 02:51:46 +03:00
config = lib.mkIf cfg.enable {
2022-10-12 01:41:32 +03:00
programs.alacritty = {
enable = true;
settings = {
window = {
padding = { x = 5; y = 5; };
decorations = "none";
dynamic_title = true;
};
scrolling = {
history = 10000;
multiplier = 3;
};
font =
let
family = "monospace";
mkFont = style: { inherit family style; };
in
{
normal = mkFont "Regular";
bold = mkFont "Bold";
italic = mkFont "Italic";
bold_italic = mkFont "Bold Italic";
size = cfg.fontSize;
};
2022-10-28 16:12:00 +03:00
colors = {
primary = {
background = themeCfg.window.background;
foreground = themeCfg.window.mainText;
dim_foreground = themeCfg.window.mainText;
bright_foreground = themeCfg.window.mainText;
};
cursor = {
text = themeCfg.window.cursorText;
cursor = themeCfg.window.cursor;
};
vi_mode_cursor = {
text = themeCfg.window.cursorText;
cursor = themeCfg.window.cursorVi;
};
search = {
matches = {
foreground = themeCfg.window.searchText;
background = themeCfg.window.search;
};
focused_match = {
foreground = themeCfg.window.searchText;
background = themeCfg.window.searchFocused;
};
footer_bar = {
foreground = themeCfg.window.footerText;
background = themeCfg.window.footer;
};
};
hints = {
start = {
foreground = themeCfg.window.hintsText;
background = themeCfg.window.hintsStart;
};
end = {
foreground = themeCfg.window.hintsText;
background = themeCfg.window.hintsEnd;
};
};
selection = {
text = themeCfg.window.selectionText;
background = themeCfg.window.selection;
};
normal = {
black = themeCfg.window.regular.color0;
red = themeCfg.window.regular.color1;
green = themeCfg.window.regular.color2;
yellow = themeCfg.window.regular.color3;
blue = themeCfg.window.regular.color4;
magenta = themeCfg.window.regular.color5;
cyan = themeCfg.window.regular.color6;
white = themeCfg.window.regular.color7;
};
bright = {
black = themeCfg.window.bold.color8;
red = themeCfg.window.bold.color9;
green = themeCfg.window.bold.color10;
yellow = themeCfg.window.bold.color11;
blue = themeCfg.window.bold.color12;
magenta = themeCfg.window.bold.color13;
cyan = themeCfg.window.bold.color14;
white = themeCfg.window.bold.color15;
};
dim = {
black = themeCfg.window.regular.color0;
red = themeCfg.window.regular.color1;
green = themeCfg.window.regular.color2;
yellow = themeCfg.window.regular.color3;
blue = themeCfg.window.regular.color4;
magenta = themeCfg.window.regular.color5;
cyan = themeCfg.window.regular.color6;
white = themeCfg.window.regular.color7;
};
indexed_colors = [
{
index = 16;
color = themeCfg.window.extended.color16;
}
{
index = 17;
color = themeCfg.window.extended.color17;
}
2022-10-28 18:58:53 +03:00
{
index = 18;
color = themeCfg.window.extended.color18;
}
{
index = 19;
color = themeCfg.window.extended.color19;
}
2022-10-28 16:12:00 +03:00
];
};
2022-10-12 01:41:32 +03:00
};
};
};
}