fix(ghostty): add cairo wrapper and make it the default terminal

This commit is contained in:
randogoth 2026-02-04 21:51:25 +02:00
parent 987aee1c5b
commit 2e58a2d4ad
5 changed files with 17 additions and 8 deletions

View file

@ -1,5 +1,11 @@
{ lib, pkgs, ... }:
let
ghosttyCairo = pkgs.writeShellScriptBin "ghostty-cairo" ''
export GSK_RENDERER=cairo
exec ghostty "$@"
'';
in
{
# Baseline system tools available everywhere; users run Home Manager standalone.
config.environment.systemPackages = lib.mkAfter [
@ -11,6 +17,7 @@
pkgs.fastfetch
pkgs.flatpak
pkgs.ghostty
ghosttyCairo
pkgs.git
pkgs.home-manager
pkgs.just

View file

@ -24,9 +24,11 @@ in
];
# Use Ghostty as the default terminal emulator.
# On some machines Ghostty may fail to acquire an OpenGL context; `ghostty-cairo`
# forces GTK4's Cairo renderer (CPU) and is more hardware-agnostic.
environment.sessionVariables = {
TERMINAL = "${pkgs.ghostty}/bin/ghostty";
DEFAULT_TERMINAL = "${pkgs.ghostty}/bin/ghostty";
TERMINAL = "ghostty-cairo";
DEFAULT_TERMINAL = "ghostty-cairo";
};
programs.bash = {