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,57 +1,28 @@
{
description = "Development Nix flake for OpenAI Codex CLI";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { nixpkgs, ... }:
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 = nixpkgs.legacyPackages.${system};
codex-rs = pkgs.callPackage ./codex-rs { };
in
{
codex-rs = codex-rs;
default = codex-rs;
}
);
};
};
outputs = { nixpkgs, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
pkgsWithRust = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
monorepo-deps = with pkgs; [
# for precommit hook
pnpm
husky
];
codex-cli = import ./codex-cli {
inherit pkgs monorepo-deps;
};
codex-rs = import ./codex-rs {
pkgs = pkgsWithRust;
inherit monorepo-deps;
};
in
rec {
packages = {
codex-cli = codex-cli.package;
codex-rs = codex-rs.package;
};
devShells = {
codex-cli = codex-cli.devShell;
codex-rs = codex-rs.devShell;
};
apps = {
codex-cli = codex-cli.app;
codex-rs = codex-rs.app;
};
defaultPackage = packages.codex-cli;
defaultApp = apps.codex-cli;
defaultDevShell = devShells.codex-cli;
}
);
}