All checks were successful
Check / eval (push) Successful in 3m41s
Ghostty needs OpenGL 4.3; older GPUs (Intel HD 4000) top out at 4.2. Installer probes glxinfo and writes settings.terminal=kitty into theme-state when below the floor. modules/home/kitty.nix enables Kitty with the same palette, mono font, and opacity as Ghostty so the fallback still looks like Nomarchy. Default machines stay Ghostty-only (no kitty in the HM closure). Doctor and calendar still invoke Ghostty by class — V3 on Acer for SUPER+Return. Verified: V0 flake check; installer-safety; HM with terminal=kitty builds themed kitty.conf + TERMINAL=kitty; default template has no kitty bin.
64 lines
2.0 KiB
Nix
64 lines
2.0 KiB
Nix
# 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;
|
||
};
|
||
};
|
||
}
|