From ebab29f4dbcb884e31951d1193cfaa72796ff422 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Fri, 3 Apr 2026 23:09:54 -0700 Subject: [PATCH] fix: reuse oven nix build output path --- oven/native-builder.mjs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/oven/native-builder.mjs b/oven/native-builder.mjs index 4f7c933714..b3eeba97be 100644 --- a/oven/native-builder.mjs +++ b/oven/native-builder.mjs @@ -613,18 +613,18 @@ async function runBuildJob(job) { job.percent = Math.max(job.percent, 85); - // Extract ISO path from nix build output - const nixOutResult = await runSync( - nixBin, - ["build", ".#usb-image", "--impure", "--no-link", "--print-out-paths"], - nixosDir, - nixEnv, - ); + // Reuse the stdout path from the build phase instead of invoking nix twice. + const nixOutResult = [...job.logs] + .reverse() + .find((entry) => + entry.stream === "stdout" && + /^\/nix\/store\/.+\.iso$/.test(entry.line || "") + )?.line || ""; if (!nixOutResult) { throw new Error("NixOS build finished without returning an output path"); } - // Find the ISO in the output directory + // Find the ISO in the output directory. const isoPath = await runSync( "bash", ["-lc", "find \"$1\" -name '*.iso' -type f | head -1", "_", nixOutResult], -- 2.51.2