From fd65fa0e62d3098ea18e836a077351995d5f75fe Mon Sep 17 00:00:00 2001 From: Ben Siraphob Date: Mon, 20 Apr 2026 11:45:53 -0700 Subject: [PATCH] codex: build only codex and disable LTO to halve build time --- pkgs/by-name/co/codex/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/co/codex/package.nix b/pkgs/by-name/co/codex/package.nix index 8f470f5f72c8..abb341eb56ef 100644 --- a/pkgs/by-name/co/codex/package.nix +++ b/pkgs/by-name/co/codex/package.nix @@ -38,6 +38,18 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-zpQ0vg9XuarLfdZYiRIhcwLHUOdunNbOb5xLW3MPzp8="; + # Match upstream's release build (codex only, no fat LTO) to cut build time. + cargoBuildFlags = [ + "--package" + "codex-cli" + "--config" + ''profile.release.lto="off"'' + ]; + cargoCheckFlags = [ + "--package" + "codex-cli" + ]; + postPatch = '' # webrtc-sys asks rustc to link libwebrtc statically by default, # but nixpkgs provides libwebrtc as a shared library.