diff --git a/pkgs/by-name/op/opencode-desktop/package.nix b/pkgs/by-name/op/opencode-desktop/package.nix index bfc0cf9c482c..8f2efe9ed76a 100644 --- a/pkgs/by-name/op/opencode-desktop/package.nix +++ b/pkgs/by-name/op/opencode-desktop/package.nix @@ -54,6 +54,12 @@ stdenvNoCC.mkDerivation (finalAttrs: { OPENCODE_CHANNEL = "prod"; MODELS_DEV_API_JSON = "${models-dev}/dist/_api.json"; OPENCODE_DISABLE_MODELS_FETCH = true; + } + # Disable code signing on macOS. Public build hosts don't have Apple Developer + # certificates, so electron-builder's `security find-identity` spawns produce + # EPERM inside the nix sandbox. + // lib.optionalAttrs stdenvNoCC.hostPlatform.isDarwin { + CSC_IDENTITY_AUTO_DISCOVERY = "false"; }; postPatch = '' @@ -73,6 +79,18 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postConfigure ''; + preBuild = lib.optionalString stdenvNoCC.hostPlatform.isDarwin '' + # Patch electron-builder to skip code signing on macOS. + # The nix sandbox on public Darwin builders cannot spawn + # `security find-identity` — trying gives spawn EPERM. + # We patch the compiled JS to make getValidIdentities a no-op. + for f in $(find node_modules -path "*/app-builder-lib/out/codeSign/macCodeSign.js" -type f 2>/dev/null); do + substituteInPlace "$f" \ + --replace-fail "async function getValidIdentities" \ + "async function getValidIdentities() { return []; }; async function getValidIdentities_DISABLED" + done + ''; + buildPhase = '' runHook preBuild @@ -98,7 +116,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { --config=electron-builder.config.ts \ --config.electronDist="$HOME/.electron-dist" \ --config.electronVersion=${electron.version} \ - --config.asarUnpack='**/*.node' + --config.asarUnpack='**/*.node' \ + ${lib.optionalString stdenvNoCC.hostPlatform.isDarwin "--config.mac.identity=null"} cd ../.. diff --git a/pkgs/by-name/op/opencode/package.nix b/pkgs/by-name/op/opencode/package.nix index d4bcfb1d45a5..6a128e88368f 100644 --- a/pkgs/by-name/op/opencode/package.nix +++ b/pkgs/by-name/op/opencode/package.nix @@ -16,13 +16,13 @@ stdenvNoCC.mkDerivation (finalAttrs: { pname = "opencode"; - version = "1.14.48"; + version = "1.15.3"; src = fetchFromGitHub { owner = "anomalyco"; repo = "opencode"; tag = "v${finalAttrs.version}"; - hash = "sha256-gyybqabTco+5ZeWv4lCX8t/R9Jm3tYsA8wVvkrxkEYQ="; + hash = "sha256-OKQR76q7trKQTvlMxH8tG2jNnRtBe3YeFfvNw8c3+8I="; }; node_modules = stdenvNoCC.mkDerivation { @@ -75,7 +75,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { # NOTE: Required else we get errors that our fixed-output derivation references store paths dontFixup = true; - outputHash = "sha256-94uXrhyGqW016U6LPE/xIfZGoDOzyUto5DyQrYYePds="; + outputHash = "sha256-O6czNd9n6b0TTIsPseZn9qOlxsPzRTrePu3L6gM13oM="; outputHashAlgo = "sha256"; outputHashMode = "recursive"; };