From 55f6a0b7eda7244a5c887c55cb5bfb62fc60dc9b Mon Sep 17 00:00:00 2001 From: Marmel Coder Date: Thu, 12 Nov 2026 02:04:06 +0300 Subject: [PATCH] feat(codex-oauth-proxy): add 1.1.1 Codex OAuth proxy package Packages dvcrn/codex-oauth-proxy, which exposes a ChatGPT Codex account through OpenAI-compatible APIs, as a buildGoModule derivation. Builds only cmd/codex-oauth-proxy because the worker package is js/wasm code, and passes -buildvcs=false because the Nix source has no .git. Upstream Go tests run offline, so doCheck is enabled. --- README.md | 1 + packages/codex-oauth-proxy/default.nix | 5 ++ packages/codex-oauth-proxy/package.nix | 73 ++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 packages/codex-oauth-proxy/default.nix create mode 100644 packages/codex-oauth-proxy/package.nix diff --git a/README.md b/README.md index d872991..18bc8da 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ A custom Nix overlay and flake providing additional packages not found in upstre | `aionui` | Free, open-source, Cowork app with AI Agents | AI Coding Agents | | `codeaf` | Coding harness and software factory for open models: hand work off, then watch every project from one terminal | AI Coding Agents | | `codex-api-proxy` | Local OpenAI-compatible HTTP proxy backed by Codex/OpenAI credentials | AI LLM Gateway | +| `codex-oauth-proxy` | Local proxy exposing a ChatGPT Codex account through OpenAI-compatible APIs | AI LLM Gateway | | `container-use` | Containerized environments for coding agents | AI Coding Agents | | `desloppify` | Multi-language codebase health scanner and technical debt tracker for AI agents | AI Coding Agents | | `ds4` | DeepSeek 4 Flash and PRO local inference engine for ROCm (Strix Halo) | AI Inference | diff --git a/packages/codex-oauth-proxy/default.nix b/packages/codex-oauth-proxy/default.nix new file mode 100644 index 0000000..291b4f4 --- /dev/null +++ b/packages/codex-oauth-proxy/default.nix @@ -0,0 +1,5 @@ +{ + pkgs, + ... +}: +pkgs.callPackage ./package.nix { } diff --git a/packages/codex-oauth-proxy/package.nix b/packages/codex-oauth-proxy/package.nix new file mode 100644 index 0000000..d5f6aae --- /dev/null +++ b/packages/codex-oauth-proxy/package.nix @@ -0,0 +1,73 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, +}: + +buildGoModule rec { + pname = "codex-oauth-proxy"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "dvcrn"; + repo = "codex-oauth-proxy"; + # Upstream tags are bare semver, without the "v" prefix. + rev = version; + hash = "sha256-WZN+OVvK5/R46Ko01jw4m9jI9BcvpZzxWifcui90/g4="; + }; + + vendorHash = "sha256-hb0rGd+HZHSV/sLXiIa7LPkXVuRqdXrQHZxM4v5sgvs="; + + env.CGO_ENABLED = 0; + + # cmd/codex-oauth-proxy-worker and parts of internal/server are js && wasm + # Cloudflare Worker code needing syscall/js, so only the server is buildable. + subPackages = [ "cmd/codex-oauth-proxy" ]; + + # The Nix source tree has no .git, so Go's VCS stamping fails without it. + # Set before the build and check phases, which both call `go`. + preConfigure = '' + export GOFLAGS="$GOFLAGS -buildvcs=false" + ''; + + ldflags = [ + "-s" + "-w" + ]; + + # Upstream CI runs `go test -v ./...` and the suite only uses httptest and + # t.Setenv, so it needs neither network nor credentials. The default check + # phase would reuse subPackages and test only the server, hence the override. + doCheck = true; + + checkPhase = '' + runHook preCheck + + # Tests may read assets relative to their package directory. + export GOFLAGS=''${GOFLAGS//-trimpath/} + + go test -v ./... + + runHook postCheck + ''; + + passthru = { + category = "AI LLM Gateway"; + updateScript = [ + "nix-update" + "--flake" + ".#codex-oauth-proxy" + ]; + }; + + meta = { + description = "Local proxy exposing a ChatGPT Codex account through OpenAI-compatible APIs"; + homepage = "https://github.com/dvcrn/codex-oauth-proxy"; + changelog = "https://github.com/dvcrn/codex-oauth-proxy/releases/tag/${version}"; + license = lib.licenses.mit; + sourceProvenance = with lib.sourceTypes; [ fromSource ]; + mainProgram = "codex-oauth-proxy"; + platforms = lib.platforms.unix; + maintainers = [ ]; + }; +}