Fix nix build (#4048)

I dropped the build of the old cli from the flake, where the default.nix
already seemed to removed in a previous iterations. Then I updated
flake.nix and codex-rs expression to be able to build again (see
individual commits for details).

Tested by running the following builds:


```
$ nix build .#packages.x86_64-linux.codex-rs
$ nix build .#packages.aarch64-darwin.codex-cli
```

---------

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
This commit is contained in:
Jörg Thalheim
2025-10-17 20:19:08 +01:00
committed by GitHub
parent c03e31ecf5
commit 44ceaf085b
3 changed files with 54 additions and 149 deletions

View File

@@ -1,42 +1,31 @@
{ pkgs, monorep-deps ? [], ... }:
let
{
openssl,
rustPlatform,
pkg-config,
lib,
...
}:
rustPlatform.buildRustPackage (finalAttrs: {
env = {
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig:$PKG_CONFIG_PATH";
PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig:$PKG_CONFIG_PATH";
};
in
rec {
package = pkgs.rustPlatform.buildRustPackage {
inherit env;
pname = "codex-rs";
version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock;
doCheck = false;
src = ./.;
nativeBuildInputs = with pkgs; [
pkg-config
openssl
];
meta = with pkgs.lib; {
description = "OpenAI Codex commandline interface rust implementation";
license = licenses.asl20;
homepage = "https://github.com/openai/codex";
};
pname = "codex-rs";
version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock;
doCheck = false;
src = ./.;
nativeBuildInputs = [
pkg-config
openssl
];
cargoLock.outputHashes = {
"ratatui-0.29.0" = "sha256-HBvT5c8GsiCxMffNjJGLmHnvG77A6cqEL+1ARurBXho=";
};
devShell = pkgs.mkShell {
inherit env;
name = "codex-rs-dev";
packages = monorep-deps ++ [
pkgs.cargo
package
];
shellHook = ''
echo "Entering development shell for codex-rs"
alias codex="cd ${package.src}/tui; cargo run; cd -"
${pkgs.rustPlatform.cargoSetupHook}
'';
meta = with lib; {
description = "OpenAI Codex commandline interface rust implementation";
license = licenses.asl20;
homepage = "https://github.com/openai/codex";
};
app = {
type = "app";
program = "${package}/bin/codex";
};
}
})