From 0644ba7b7e00dfe308794b3bb3adff6ec717707d Mon Sep 17 00:00:00 2001 From: Rohan Godha Date: Fri, 20 Feb 2026 22:32:15 -0500 Subject: [PATCH] fix(nix): include libcap dependency on linux builds (#12415) commit 923f9311215df350248e4a314e8931bfb9033bcd introduced a dependency on `libcap`. This PR fixes the nix build by including `libcap` in nix's build inputs issue number: #12102. @etraut-openai gave me permission to open pr Testing: running `nix run .#codex-rs` works on both macos (aarch64) and nixos (x86-64) --- codex-rs/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/codex-rs/default.nix b/codex-rs/default.nix index fc7dd978ef..80896689f9 100644 --- a/codex-rs/default.nix +++ b/codex-rs/default.nix @@ -2,16 +2,18 @@ cmake, llvmPackages, openssl, + libcap ? null, rustPlatform, pkg-config, lib, + stdenv, version ? "0.0.0", ... }: rustPlatform.buildRustPackage (_: { - env = { - PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig:$PKG_CONFIG_PATH"; - }; + env.PKG_CONFIG_PATH = lib.makeSearchPathOutput "dev" "lib/pkgconfig" ( + [ openssl ] ++ lib.optionals stdenv.isLinux [ libcap ] + ); pname = "codex-rs"; inherit version; cargoLock.lockFile = ./Cargo.lock; @@ -31,6 +33,8 @@ rustPlatform.buildRustPackage (_: { llvmPackages.libclang.lib openssl pkg-config + ] ++ lib.optionals stdenv.isLinux [ + libcap ]; cargoLock.outputHashes = { @@ -47,5 +51,6 @@ rustPlatform.buildRustPackage (_: { description = "OpenAI Codex command‑line interface rust implementation"; license = licenses.asl20; homepage = "https://github.com/openai/codex"; + mainProgram = "codex"; }; })