From f624449c12f905669bc7ede446e913c3d5ca75f5 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Fri, 27 Feb 2026 17:57:04 +0000 Subject: start: add --force-nixgl and check /run/opengl-driver (#13385) --- start/src/helpers/Nix.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'start/src/helpers/Nix.cpp') diff --git a/start/src/helpers/Nix.cpp b/start/src/helpers/Nix.cpp index 07cd2a4a..da66183e 100644 --- a/start/src/helpers/Nix.cpp +++ b/start/src/helpers/Nix.cpp @@ -82,6 +82,9 @@ std::expected Nix::nixEnvironmentOk() { } bool Nix::shouldUseNixGL() { + if (g_state->forceNixGl) + return true; + if (g_state->noNixGl) return false; @@ -103,7 +106,19 @@ bool Nix::shouldUseNixGL() { if (IS_NIX) { const auto NAME = getFromEtcOsRelease("NAME"); - return !NAME || *NAME != "NixOS"; + + // Hyprland is nix: recommend nixGL iff !NIX && !NIX-OPENGL + + if (*NAME == "NixOS") + return false; + + std::error_code ec; + + if (std::filesystem::exists("/run/opengl-driver", ec) && !ec) // NOLINTNEXTLINE + return false; + + // we are not on nix / no nix opengl driver + return true; } return false; -- cgit v1.2.3