From b3df38ac804164403665ec47d6073850d7dbd2d9 Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 13 Jul 2026 23:20:51 +0200 Subject: [PATCH 1/3] fix(nix): relax Bun version check for desktop build --- nix/desktop.nix | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/nix/desktop.nix b/nix/desktop.nix index d0d7fa7eca1f..6e2381455157 100644 --- a/nix/desktop.nix +++ b/nix/desktop.nix @@ -42,16 +42,23 @@ stdenv.mkDerivation (finalAttrs: { ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; }; - # https://github.com/electron/electron/issues/31121 - # mac builds use a .app bundle which doesnt have this issue - postPatch = lib.optionalString stdenv.isLinux '' - BASE_PATH=packages/desktop - FILES=(src/main/windows.ts) - for file in "''${FILES[@]}"; do - substituteInPlace $BASE_PATH/$file \ - --replace-fail "process.resourcesPath" "'$out/opt/opencode-desktop/resources'" - done - ''; + postPatch = + '' + # NOTE: Relax Bun version check to be a warning instead of an error + substituteInPlace packages/script/src/index.ts \ + --replace-fail 'throw new Error(`This script requires bun@''${expectedBunVersionRange}' \ + 'console.warn(`Warning: This script requires bun@''${expectedBunVersionRange}' + '' + # https://github.com/electron/electron/issues/31121 + # mac builds use a .app bundle which doesnt have this issue + + lib.optionalString stdenv.isLinux '' + BASE_PATH=packages/desktop + FILES=(src/main/windows.ts) + for file in "''${FILES[@]}"; do + substituteInPlace $BASE_PATH/$file \ + --replace-fail "process.resourcesPath" "'$out/opt/opencode-desktop/resources'" + done + ''; preBuild = '' cp -r "${electron.dist}" $HOME/.electron-dist From 0da907947a38d78fc7386a1003cb3b2c7adbc76c Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 13 Jul 2026 23:47:01 +0200 Subject: [PATCH 2/3] chore(nix): align desktop postPatch comment --- nix/desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/desktop.nix b/nix/desktop.nix index 6e2381455157..4b65ea438fa0 100644 --- a/nix/desktop.nix +++ b/nix/desktop.nix @@ -42,9 +42,9 @@ stdenv.mkDerivation (finalAttrs: { ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; }; + # NOTE: Relax Bun version check to be a warning instead of an error postPatch = '' - # NOTE: Relax Bun version check to be a warning instead of an error substituteInPlace packages/script/src/index.ts \ --replace-fail 'throw new Error(`This script requires bun@''${expectedBunVersionRange}' \ 'console.warn(`Warning: This script requires bun@''${expectedBunVersionRange}' From 985dd95256f4c359e0db2ba83e38d59a798e5a6c Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 13 Jul 2026 23:56:54 +0200 Subject: [PATCH 3/3] chore(nix): place postPatch comment before string --- nix/desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/desktop.nix b/nix/desktop.nix index 4b65ea438fa0..a905b5d92687 100644 --- a/nix/desktop.nix +++ b/nix/desktop.nix @@ -42,8 +42,8 @@ stdenv.mkDerivation (finalAttrs: { ELECTRON_SKIP_BINARY_DOWNLOAD = "1"; }; - # NOTE: Relax Bun version check to be a warning instead of an error postPatch = + # NOTE: Relax Bun version check to be a warning instead of an error '' substituteInPlace packages/script/src/index.ts \ --replace-fail 'throw new Error(`This script requires bun@''${expectedBunVersionRange}' \