{ lib, config, ... }:

let
  cfg = config.snowhawk.alacritty;
  macos = config.snowhawk.macos.enable;
in
{
  options.snowhawk.alacritty = {
    enable = lib.mkEnableOption "alacritty home-manager module";
  };

  config = lib.mkIf cfg.enable {
    programs.alacritty = {
      enable = true;
      settings = {
        window = {
          opacity = 0.98;
          decorations = lib.mkIf macos "buttonless";
          option_as_alt = lib.mkIf macos "Both";
        };
        colors = {
          primary.background = "#050505";
        };
        font = {
          size = 12.0;
          normal = {
            family = "JetBrainsMono Nerd Font";
            style = "Regular";
          };
          bold = {
            family = "JetBrainsMono Nerd Font";
            style = "SemiBold";
          };
          italic = {
            family = "JetBrainsMono Nerd Font";
            style = "Italic";
          };
          bold_italic = {
            family = "JetBrainsMono Nerd Font";
            style = "SemiBold Italic";
          };
        };
      };
    };
  };
}