diff --git a/modules/desktop/desktop-entries.nix b/modules/desktop/desktop-entries.nix index 1db26e5..ef8f253 100644 --- a/modules/desktop/desktop-entries.nix +++ b/modules/desktop/desktop-entries.nix @@ -29,7 +29,7 @@ let name = "com.mitchellh.ghostty"; desktopName = "Terminal"; genericName = "Terminal Emulator"; - exec = "ghostty"; + exec = "ghostty-cairo"; icon = "com.mitchellh.ghostty"; categories = [ "System" @@ -37,7 +37,7 @@ let "Utility" ]; terminal = false; - comment = "Fast GPU-accelerated terminal"; + comment = "Terminal (Cairo renderer fallback)"; }; in { diff --git a/modules/desktop/gnome-minimal.nix b/modules/desktop/gnome-minimal.nix index 5c9e9ea..4825909 100644 --- a/modules/desktop/gnome-minimal.nix +++ b/modules/desktop/gnome-minimal.nix @@ -50,7 +50,7 @@ in "org/gnome/shell/extensions/logo-menu" = { menu-button-icon-image = lib.gvariant.mkInt32 51; - menu-button-terminal = "ghostty"; + menu-button-terminal = "ghostty-cairo"; menu-button-system-monitor = "missioncenter"; menu-button-extensions-app = "com.mattjakeman.ExtensionManager.desktop"; hide-softwarecentre = true; diff --git a/modules/system/packages.nix b/modules/system/packages.nix index e738730..00a38be 100644 --- a/modules/system/packages.nix +++ b/modules/system/packages.nix @@ -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 diff --git a/modules/system/shell.nix b/modules/system/shell.nix index 86e7b49..da80556 100644 --- a/modules/system/shell.nix +++ b/modules/system/shell.nix @@ -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 = { diff --git a/templates/home-home.nix b/templates/home-home.nix index e59fd49..9f78f5e 100644 --- a/templates/home-home.nix +++ b/templates/home-home.nix @@ -97,7 +97,7 @@ [no-cd] switch: -home-manager switch --flake ~/.config/home-manager#$USER + home-manager switch --flake ~/.config/home-manager#$USER [no-cd] rebuild: @@ -111,8 +111,8 @@ home-manager switch --flake ~/.config/home-manager#$USER home.sessionVariables = { # you can change the default terminal and editor here - TERMINAL = "${pkgs.ghostty}/bin/ghostty"; - DEFAULT_TERMINAL = "${pkgs.ghostty}/bin/ghostty"; + TERMINAL = "ghostty-cairo"; + DEFAULT_TERMINAL = "ghostty-cairo"; EDITOR = "micro"; DBX_CONTAINER_HOME_PREFIX = "$HOME/distrobox"; };