summaryrefslogtreecommitdiff
path: root/hyprpm/src/helpers/Sys.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-02-10 15:12:43 +0000
committerGitHub <noreply@github.com>2026-02-10 15:12:43 +0000
commit857a78ce4ebd7b397d6f56d1436c4f06a99be9fc (patch)
tree78d70a20b4d64bfd2fabd25834091932002b1786 /hyprpm/src/helpers/Sys.cpp
parent339661229dd65161ec904fdc73390316a095bd46 (diff)
hyprpm: add full nix integration (#13189)
Adds nix integration to hyprpm: hyprpm will now detect nix'd hyprland and use nix develop instead --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'hyprpm/src/helpers/Sys.cpp')
-rw-r--r--hyprpm/src/helpers/Sys.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/hyprpm/src/helpers/Sys.cpp b/hyprpm/src/helpers/Sys.cpp
index c18d4748..e9dd4c85 100644
--- a/hyprpm/src/helpers/Sys.cpp
+++ b/hyprpm/src/helpers/Sys.cpp
@@ -35,9 +35,13 @@ static std::string validSubinsAsStr() {
}
static bool executableExistsInPath(const std::string& exe) {
+ return NSys::findInPath(exe).has_value();
+}
+
+std::optional<std::string> NSys::findInPath(const std::string& exe) {
const char* PATHENV = std::getenv("PATH");
if (!PATHENV)
- return false;
+ return std::nullopt;
CVarList paths(PATHENV, 0, ':', true);
std::error_code ec;
@@ -52,10 +56,10 @@ static bool executableExistsInPath(const std::string& exe) {
if (ec)
continue;
if ((perms & std::filesystem::perms::others_exec) != std::filesystem::perms::none)
- return true;
+ return candidate.string();
}
- return false;
+ return std::nullopt;
}
static std::string subin() {