mirror of
https://github.com/openai/codex.git
synced 2026-02-01 14:44:17 +00:00
## Summary - Add rust-overlay input to provide newer Rust versions (rama crates require rustc 1.91.0+) - Add devShells output with complete development environment - Add missing git dependency hashes to codex-rs/default.nix ## Changes **flake.nix:** - Added `rust-overlay` input to get newer Rust toolchains - Updated `packages` output to use `rust-bin.stable.latest.minimal` for builds - Added `devShells` output with: - Rust with `rust-src` and `rust-analyzer` extensions for IDE support - Required build dependencies: `pkg-config`, `openssl`, `cmake`, `libclang` - Environment variables: `PKG_CONFIG_PATH`, `LIBCLANG_PATH` **codex-rs/default.nix:** - Added missing `outputHashes` for git dependencies: - `nucleo-0.5.0`, `nucleo-matcher-0.3.1` - `runfiles-0.1.0` - `tokio-tungstenite-0.28.0`, `tungstenite-0.28.0` ## Test Plan - [x] `nix develop` enters shell successfully - [x] `nix develop -c rustc --version` shows 1.93.0 - [x] `nix develop -c cargo build` completes successfully
74 lines
2.0 KiB
Nix
74 lines
2.0 KiB
Nix
{
|
|
description = "Development Nix flake for OpenAI Codex CLI";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
rust-overlay = {
|
|
url = "github:oxalica/rust-overlay";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { nixpkgs, rust-overlay, ... }:
|
|
let
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems f;
|
|
in
|
|
{
|
|
packages = forAllSystems (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ rust-overlay.overlays.default ];
|
|
};
|
|
codex-rs = pkgs.callPackage ./codex-rs {
|
|
rustPlatform = pkgs.makeRustPlatform {
|
|
cargo = pkgs.rust-bin.stable.latest.minimal;
|
|
rustc = pkgs.rust-bin.stable.latest.minimal;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
codex-rs = codex-rs;
|
|
default = codex-rs;
|
|
}
|
|
);
|
|
|
|
devShells = forAllSystems (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [ rust-overlay.overlays.default ];
|
|
};
|
|
rust = pkgs.rust-bin.stable.latest.default.override {
|
|
extensions = [ "rust-src" "rust-analyzer" ];
|
|
};
|
|
in
|
|
{
|
|
default = pkgs.mkShell {
|
|
buildInputs = [
|
|
rust
|
|
pkgs.pkg-config
|
|
pkgs.openssl
|
|
pkgs.cmake
|
|
pkgs.llvmPackages.clang
|
|
pkgs.llvmPackages.libclang.lib
|
|
];
|
|
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
|
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
|
# Use clang for BoringSSL compilation (avoids GCC 15 warnings-as-errors)
|
|
shellHook = ''
|
|
export CC=clang
|
|
export CXX=clang++
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|