{ pkgs, ... }@all: with all;
{
  programs.ghostty = {
    enable = true;
    package = pkgs.ghostty;
    settings = with rice.color; {
      background = background;
      background-opacity = builtins.toString rice.transparency;
      clipboard-paste-protection = false;
      clipboard-read = "allow";
      clipboard-trim-trailing-spaces = true;
      confirm-close-surface = false;
      cursor-color = special.bright;
      cursor-opacity = 0.8;
      font-family = "${rice.font.code.name}";
      foreground = foreground;
      keybind = [
        "ctrl+comma=reload_config"
        "ctrl+equal=increase_font_size:1"
        "ctrl+minus=decrease_font_size:1"
        "ctrl+shift+v=paste_from_clipboard"
      ];
      palette = with rice; [
        "0=${black.base}"
        "8=${black.bright}"
        "1=${red.base}"
        "9=${red.bright}"
        "2=${green.base}"
        "10=${green.bright}"
        "3=${yellow.base}"
        "11=${yellow.bright}"
        "4=${blue.base}"
        "12=${blue.bright}"
        "5=${magenta.base}"
        "13=${magenta.bright}"
        "6=${cyan.base}"
        "14=${cyan.bright}"
        "7=${white.base}"
        "15=${white.bright}"
      ];
      selection-background = accent.base; 
      selection-foreground = background;
      window-decoration = false;
      window-padding-x = 5;
      window-padding-y = 5;
    };
  };
}
