summaryrefslogtreecommitdiff
path: root/start/src/helpers/Nix.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-02-27 17:57:04 +0000
committerGitHub <noreply@github.com>2026-02-27 17:57:04 +0000
commitf624449c12f905669bc7ede446e913c3d5ca75f5 (patch)
treef30180d354793fda2c1ce78075e97af9ee1c9e39 /start/src/helpers/Nix.cpp
parent70cdd819e4bee3c4dcea6961d32e61e6afe4eeb0 (diff)
start: add --force-nixgl and check /run/opengl-driver (#13385)
Diffstat (limited to 'start/src/helpers/Nix.cpp')
-rw-r--r--start/src/helpers/Nix.cpp17
1 files changed, 16 insertions, 1 deletions
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<void, std::string> 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;