summaryrefslogtreecommitdiff
path: root/start/src/core/Instance.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-01-08 10:57:56 +0100
committerGitHub <noreply@github.com>2026-01-08 10:57:56 +0100
commit836856604407da41e1c38324abd812b7884637b8 (patch)
tree87796eaead9481e1ce1a034ab8d90e4f4eba343d /start/src/core/Instance.cpp
parent918e2bb9be0e1d233f9394f1d569137788c43c01 (diff)
start: use nixGL if Hyprland is nix but not NixOS (#12845)
--------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'start/src/core/Instance.cpp')
-rw-r--r--start/src/core/Instance.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/start/src/core/Instance.cpp b/start/src/core/Instance.cpp
index ec56cc75..2f5007bd 100644
--- a/start/src/core/Instance.cpp
+++ b/start/src/core/Instance.cpp
@@ -1,6 +1,7 @@
#include "Instance.hpp"
#include "State.hpp"
#include "../helpers/Logger.hpp"
+#include "../helpers/Nix.hpp"
#include <cstdlib>
#include <cstring>
@@ -54,7 +55,12 @@ void CHyprlandInstance::runHyprlandThread(bool safeMode) {
procctl(P_PID, getpid(), PROC_PDEATHSIG_CTL, &sig);
#endif
- execvp(g_state->customPath.value_or("Hyprland").c_str(), args.data());
+ if (Nix::shouldUseNixGL()) {
+ argsStd.insert(argsStd.begin(), g_state->customPath.value_or("Hyprland"));
+ args.insert(args.begin(), strdup(argsStd.front().c_str()));
+ execvp("nixGL", args.data());
+ } else
+ execvp(g_state->customPath.value_or("Hyprland").c_str(), args.data());
g_logger->log(Hyprutils::CLI::LOG_ERR, "fork(): execvp failed: {}", strerror(errno));
std::fflush(stdout);