summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Fufezan <mihai@fufexan.net>2025-12-15 17:59:08 +0200
committerGitHub <noreply@github.com>2025-12-15 15:59:08 +0000
commit4036c37e5578d9d8558bacbf590becc09c7d51b2 (patch)
treedcedbd343188a0104ad02a3d012c9d048a2cb10c
parent7ccc57eb7cacded5e7a8835b705bba48963d3cb3 (diff)
hyprctl: add nix flag (#12653)
-rw-r--r--CMakeLists.txt4
-rw-r--r--nix/default.nix1
-rw-r--r--src/debug/HyprCtl.cpp8
3 files changed, 12 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a192a694..d3af715d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -321,6 +321,10 @@ if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
endif()
endif()
+if(BUILT_WITH_NIX)
+ add_compile_definitions(BUILT_WITH_NIX)
+endif()
+
check_include_file("execinfo.h" EXECINFOH)
if(EXECINFOH)
message(STATUS "Configuration supports execinfo")
diff --git a/nix/default.nix b/nix/default.nix
index 27ecdf60..dc9c0bb1 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -192,6 +192,7 @@ in
dontStrip = debug;
cmakeFlags = mapAttrsToList cmakeBool {
+ "BUILT_WITH_NIX" = true;
"NO_XWAYLAND" = !enableXWayland;
"LEGACY_RENDERER" = legacyRenderer;
"NO_SYSTEMD" = !withSystemd;
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index ad7f592c..5e21d699 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -1067,7 +1067,7 @@ std::string versionRequest(eHyprCtlOutputFormat format, std::string request) {
result += __hyprland_api_get_hash();
result += "\n";
-#if (!ISDEBUG && !defined(NO_XWAYLAND))
+#if (!ISDEBUG && !defined(NO_XWAYLAND) && !defined(BUILT_WITH_NIX))
result += "no flags were set\n";
#else
result += "flags set:\n";
@@ -1077,6 +1077,9 @@ std::string versionRequest(eHyprCtlOutputFormat format, std::string request) {
#ifdef NO_XWAYLAND
result += "no xwayland\n";
#endif
+#ifdef BUILT_WITH_NIX
+ result += "nix\n";
+#endif
#endif
return result;
} else {
@@ -1113,6 +1116,9 @@ std::string versionRequest(eHyprCtlOutputFormat format, std::string request) {
#ifdef NO_XWAYLAND
result += "\"no xwayland\",";
#endif
+#ifdef BUILT_WITH_NIX
+ result += "\"nix\",";
+#endif
trimTrailingComma(result);