# Kitty — fallback terminal when Ghostty cannot run (OpenGL < 4.3 on # older GPUs, e.g. Intel HD 4000). Themed from the same theme-state.json # as Ghostty so a machine that needs the fallback still looks like # Nomarchy. Enabled when nomarchy.terminal is "kitty" (installer sets # that after a GL probe) or when nomarchy.kitty.enable is forced on. { config, lib, ... }: let t = config.nomarchy.theme; c = t.colors; # Default terminal may be a bare name ("kitty") or a path; match the # basename so settings.terminal = "kitty" and nomarchy.terminal = # "${pkgs.kitty}/bin/kitty" both light this module. terminalIsKitty = let term = config.nomarchy.terminal; base = lib.last (lib.splitString "/" term); in base == "kitty" || lib.hasPrefix "kitty " term; enabled = config.nomarchy.kitty.enable || terminalIsKitty; # Kitty colorN = ANSI 0–15 from the theme palette. colorSettings = lib.listToAttrs ( lib.imap0 (i: color: { name = "color${toString i}"; value = color; }) t.ansi ); in { config = lib.mkIf enabled { programs.kitty = { enable = true; shellIntegration.enableBashIntegration = true; shellIntegration.enableZshIntegration = true; font = { name = t.fonts.mono; size = t.fonts.size; }; settings = { background = c.base; foreground = c.text; cursor = c.accent; cursor_text_color = c.base; selection_background = c.overlay; selection_foreground = c.text; url_color = c.accent; active_border_color = c.accent; inactive_border_color = c.surface; # Match Ghostty's padding / opacity so the two terminals feel # like the same product when a machine falls back. background_opacity = t.ui.terminalOpacity; window_padding_width = lib.mkDefault 12; confirm_os_window_close = lib.mkDefault 0; enable_audio_bell = lib.mkDefault false; wayland_titlebar_color = lib.mkDefault "background"; } // colorSettings; }; }; }