From 70ce86cd53e24e17cdc3216de4461e991bb994cb Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 4 Apr 2026 22:01:43 +0300 Subject: [PATCH] fix(scripts): electron rebuild failing in flake --- scripts/electron-rebuild.mts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/electron-rebuild.mts b/scripts/electron-rebuild.mts index 0421bdba5e..9bea7ac8cd 100644 --- a/scripts/electron-rebuild.mts +++ b/scripts/electron-rebuild.mts @@ -6,8 +6,9 @@ import { isNixOS } from "./utils.mjs"; const workspaceRoot = join(import.meta.dirname, ".."); -// On NixOS, re-execute this script inside `nix develop` to get access to Python and other build tools -if (isNixOS() && !process.env.IN_NIX_SHELL) { +// On NixOS, re-execute this script inside `nix develop` to get access to Python and other build tools. +// Skip this if we're already inside a nix shell or a nix build (NIX_BUILD_TOP is set during `nix build`). +if (isNixOS() && !process.env.IN_NIX_SHELL && !process.env.NIX_BUILD_TOP) { console.log("Detected NixOS, re-running electron-rebuild inside 'nix develop'..."); try { execSync("nix develop -c pnpm exec tsx scripts/electron-rebuild.mts", {