{ config, lib, ... }:

let
  cfg = config.subs.alacritty;
in
{
  options.subs.alacritty.enable = lib.mkOption {
    default = false;
    type = lib.types.bool;
  };

  config = lib.mkIf cfg.enable {
    programs.alacritty = {
      enable = true;
      settings = {
        general.live_config_reload = true;
        general.import = [
          "~/.config/alacritty/themes/kanagawabones.toml"
        ];
        colors.draw_bold_text_with_bright_colors = true;
        font = {
          size = 15;
          normal = {
            family = "Iosevka Nerd Font";
            style = "Medium";
          };
          italic = {
            style = "Medium Italic";
          };
          bold = {
            style = "ExtraBold";
          };
          bold_italic = {
            style = "ExtraBold Italic";
          };
        };
        scrolling = {
          history = 100000;
          multiplier = 3;
        };
        window = {
          decorations = "full";
          dynamic_padding = false;
          dynamic_title = true;
          startup_mode = "Maximized";
          padding.x = 0;
          padding.y = 0;
        };
      };
    };

    home.file = {
      ".config/alacritty/themes/kanagawabones.toml".source = ../../config/theme-files/kanagawabones.toml;
    };
  };
}
