From 87e05c2cdde1f9d7b21d1af5912b543382b38f9f Mon Sep 17 00:00:00 2001 From: Bet4 <0xbet4@gmail.com> Date: Tue, 6 Oct 2026 08:49:06 +0800 Subject: [PATCH 1/2] fix(nix): use wrapped Electron in dev shell --- flake.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 4a8c39f2f..45abccdde 100644 --- a/flake.nix +++ b/flake.nix @@ -125,7 +125,11 @@ # Tell the npm `electron` package to use the Nix-provided binary # instead of downloading its own. vite-plugin-electron respects this. - ELECTRON_OVERRIDE_DIST_PATH = "${electron}/libexec/electron"; + ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; + ELECTRON_OVERRIDE_DIST_PATH = + if pkgs.stdenv.hostPlatform.isDarwin + then "${electron}/Applications" + else "${electron}/bin"; # Playwright browser path for test:browser / test:e2e PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}"; From d879ff279d3a2b1178f90493535db9d6795c44e2 Mon Sep 17 00:00:00 2001 From: EtienneLescot Date: Sat, 10 Oct 2026 10:42:15 +0200 Subject: [PATCH 2/2] fix(nix): point the dev shell at bin/ on every system The flake only defines Linux systems, so the Darwin branch never evaluated. It was also wrong with the download skipped: without path.txt the npm package resolves Applications/electron, which does not exist. nixpkgs ships bin/electron on Darwin too. --- flake.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 45abccdde..9157dc6e3 100644 --- a/flake.nix +++ b/flake.nix @@ -125,11 +125,12 @@ # Tell the npm `electron` package to use the Nix-provided binary # instead of downloading its own. vite-plugin-electron respects this. + # bin/ holds the wrapped launcher; libexec/electron/electron is the + # bare binary, which runs without the wrapper's GIO/GTK environment. + # With the download skipped there is no path.txt, so the package + # appends `electron` to this directory. ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; - ELECTRON_OVERRIDE_DIST_PATH = - if pkgs.stdenv.hostPlatform.isDarwin - then "${electron}/Applications" - else "${electron}/bin"; + ELECTRON_OVERRIDE_DIST_PATH = "${electron}/bin"; # Playwright browser path for test:browser / test:e2e PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";