fix(nix): include libcap dependency on linux builds (#12415)

commit 923f931121 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)
This commit is contained in:
Rohan Godha
2026-02-20 22:32:15 -05:00
committed by GitHub
parent 6817f0be8a
commit 0644ba7b7e

View File

@@ -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 commandline interface rust implementation";
license = licenses.asl20;
homepage = "https://github.com/openai/codex";
mainProgram = "codex";
};
})