summaryrefslogtreecommitdiff
path: root/start/src/helpers/Nix.cpp
diff options
context:
space:
mode:
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;