From 91f8beffb982f2f6878197d15eebaa387c3ce472 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Thu, 23 Apr 2026 08:14:08 +0100 Subject: [PATCH] ghostty: fix Super+T by fixing wrapGL shebang and NixOS detection The wrapGL wrapper had #!/bin/bash which doesn't exist on NixOS, so niri's execvp("ghostty") was failing silently. Shells masked the bug by falling back through sh. Switch to ${pkgs.runtimeShell}. Also fix useNixGL: the check '"system" ? config' always returned false (tested attribute on a string, not an attrset), causing ghostty to be nixGL-wrapped on NixOS where native Mesa works. Use osConfig == null to detect standalone home-manager instead. --- modules/home/gl.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/home/gl.nix b/modules/home/gl.nix index 3eed353..0955370 100644 --- a/modules/home/gl.nix +++ b/modules/home/gl.nix @@ -1,7 +1,9 @@ -{ config, pkgs, lib, ... }: +{ config, osConfig ? null, pkgs, lib, ... }: let # https://github.com/nix-community/nixGL - useNixGL = !("system" ? config) && !config.isMacOS; # if not NixOS + # Only wrap when running standalone home-manager on a non-NixOS Linux distro; + # NixOS and nix-darwin provide working GL drivers natively. + useNixGL = osConfig == null && !config.isMacOS; wrapGL = { name, package }: # wrap a package's bins with nixGL if useNixGL then pkgs.runCommand "${name}-wrapped" { @@ -17,8 +19,8 @@ let filename=$(basename "$file") newfile="$out/bin/$filename" - echo "#!/bin/bash" > "$newfile" - echo "${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL \"$file\" \"\$@\"" >> "$newfile" + echo "#!${pkgs.runtimeShell}" > "$newfile" + echo "exec ${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL \"$file\" \"\$@\"" >> "$newfile" chmod +x "$newfile" done '' -- 2.51.2