Skip to content

Commit 73cdc5e

Browse files
authored
chore(codex-cli): drop vendored npm wrapper, use nixpkgs#codex (0.133.0) (#684)
OpenAI rewrote codex in Rust mid-2025 and nixpkgs now ships it under `codex` (currently 0.133.0). Our vendored derivation pinned npm `@openai/codex` 0.46.0 and was carrying ~89 minor versions of drift behind upstream — and the npm package itself has since moved to per-arch optionalDependencies that don't fit our existing build shape. Easier and cleaner: stop maintaining the wrapper, consume nixpkgs. Changes: - module.nix: `codex-cli = pkgs.codex` instead of callPackage ./. - module.nix + codex-cli.nix: drop `codex = "codex-cli"` aliases (`codex` is the real binary name now); rest of the convenience aliases (ai-code, openai-codex, cx, code-ai) repoint to `codex`. - module.nix: fix `CODEX_BIN` path in the codex-project helper script from `bin/codex-cli` to `bin/codex`. - Delete `home/development/codex-cli/{default.nix,package-lock.json}` (the old npm wrapper). Verified: razer + p620 + p510 system closures all build clean.
1 parent b1592f6 commit 73cdc5e

4 files changed

Lines changed: 18 additions & 118 deletions

File tree

home/development/codex-cli.nix

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
# API key integration (use agenix secret)
2121
apiKeyFile = "/run/agenix/api-openai";
2222

23-
# Enhanced shell aliases for convenience
23+
# Enhanced shell aliases for convenience. `codex` is the real binary
24+
# name from nixpkgs#codex — no need to alias it. The rest stay so
25+
# existing muscle memory keeps working.
2426
shellAliases = {
25-
codex = "codex-cli";
26-
ai-code = "codex-cli";
27-
openai-codex = "codex-cli";
28-
cx = "codex-cli"; # Short alias
29-
code-ai = "codex-cli";
27+
ai-code = "codex";
28+
openai-codex = "codex";
29+
cx = "codex"; # Short alias
30+
code-ai = "codex";
3031

3132
# Project-specific aliases
3233
codex-project = "codex-project";

home/development/codex-cli/default.nix

Lines changed: 0 additions & 87 deletions
This file was deleted.

home/development/codex-cli/module.nix

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ let
44
inherit (lib) mkOption mkIf mkEnableOption types;
55
cfg = config.programs.codex-cli;
66

7-
codex-cli = pkgs.callPackage ./. { inherit (pkgs) nodejs_24; };
7+
# Use nixpkgs's `codex` package (Rust-based, upstream-maintained).
8+
# We previously vendored an npm-based @openai/codex 0.46.0 derivation;
9+
# OpenAI rewrote codex in Rust mid-2025 and nixpkgs tracks it, so we
10+
# just consume that and stop maintaining our own packaging.
11+
codex-cli = pkgs.codex;
812

913
# Note: Configuration template available but using inline generation instead
1014
# configFile = pkgs.writeText "codex-config.json" (builtins.toJSON {
@@ -81,11 +85,12 @@ in
8185
shellAliases = mkOption {
8286
type = types.attrsOf types.str;
8387
default = {
84-
codex = "codex-cli";
85-
ai-code = "codex-cli";
86-
openai-codex = "codex-cli";
88+
# `codex` is the real binary name in nixpkgs#codex; keep the rest
89+
# as convenience aliases so existing muscle memory still works.
90+
ai-code = "codex";
91+
openai-codex = "codex";
8792
};
88-
description = "Shell aliases for codex-cli";
93+
description = "Shell aliases for codex";
8994
};
9095

9196
extraConfig = mkOption {
@@ -116,7 +121,7 @@ in
116121
117122
set -euo pipefail
118123
119-
CODEX_BIN="${cfg.package}/bin/codex-cli"
124+
CODEX_BIN="${cfg.package}/bin/codex"
120125
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
121126
122127
# Function to analyze project context

home/development/codex-cli/package-lock.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)