From 62a0a44049b1a632d2a7ad3ae9770646c2fd8111 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 4 Sep 2025 09:26:16 +0300 Subject: [PATCH] chore(dx): have electron-rebuild read from path on NixOS too --- scripts/utils.mts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/utils.mts b/scripts/utils.mts index ea63f3760..65b1bad6e 100644 --- a/scripts/utils.mts +++ b/scripts/utils.mts @@ -23,6 +23,15 @@ function resetPath() { export function getElectronPath() { if (isNixOS()) { resetPath(); + + try { + const path = execSync("which electron").toString("utf-8").trimEnd(); + return path; + } catch (e) { + // Nothing to do, since we have a fallback below. + } + + console.log("Using default since no Electron is available in path."); return execSync("nix eval --raw nixpkgs#electron_37").toString("utf-8") + "/bin/electron"; } else { return "electron";