diff --git a/README.md b/README.md index 8f4c8a0..d872991 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ A custom Nix overlay and flake providing additional packages not found in upstre | `awgen` | Offline CLI for AmneziaWG configurations — harmonises native .conf and vpn:// inputs, generates client participants and tunnels, and analyses obfuscation | Networking | | `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 | | `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-api-proxy/default.nix b/packages/codex-api-proxy/default.nix new file mode 100644 index 0000000..291b4f4 --- /dev/null +++ b/packages/codex-api-proxy/default.nix @@ -0,0 +1,5 @@ +{ + pkgs, + ... +}: +pkgs.callPackage ./package.nix { } diff --git a/packages/codex-api-proxy/package.nix b/packages/codex-api-proxy/package.nix new file mode 100644 index 0000000..d0b5831 --- /dev/null +++ b/packages/codex-api-proxy/package.nix @@ -0,0 +1,70 @@ +{ + lib, + python3Packages, + fetchPypi, +}: + +python3Packages.buildPythonApplication rec { + pname = "codex-api-proxy"; + version = "0.1.6"; + pyproject = true; + + # The sdist filename uses an underscore; PyPI's legacy source path only + # resolves that spelling. + src = fetchPypi { + pname = "codex_api_proxy"; + inherit version; + hash = "sha256-EjH5Lz1hYH0K/i6kzcXVZMJSWSppuibOP5hVreod6po="; + }; + + # pyproject.toml has no [build-system] table, so the default setuptools + # backend builds the src/ layout. + build-system = with python3Packages; [ + setuptools + ]; + + # [project.dependencies] plus the uvicorn[standard] extra. + dependencies = with python3Packages; [ + fastapi + httpx + uvicorn + ] ++ uvicorn.optional-dependencies.standard; + + nativeCheckInputs = with python3Packages; [ + pytestCheckHook + pytest-asyncio + ]; + + # test_release_version.py imports scripts/set_version.py and expects the + # Makefile, neither of which is part of the sdist. + disabledTestPaths = [ "tests/test_release_version.py" ]; + + # These two monkeypatch main's auth loader, but models.list_models calls the + # auth module's loader directly, so they need a real ~/.codex/auth.json. + disabledTests = [ + "test_models_endpoint_uses_cache" + "test_models_endpoint_refresh_bypasses_cache" + ]; + + pythonImportsCheck = [ "codex_api_proxy" ]; + + passthru = { + category = "AI LLM Gateway"; + updateScript = [ + "nix-update" + "--flake" + ".#codex-api-proxy" + ]; + }; + + meta = { + description = "Local OpenAI-compatible HTTP proxy backed by Codex/OpenAI credentials"; + homepage = "https://pypi.org/project/codex-api-proxy/"; + changelog = "https://pypi.org/project/codex-api-proxy/#history"; + license = lib.licenses.mit; + sourceProvenance = with lib.sourceTypes; [ fromSource ]; + mainProgram = "codex-api-proxy"; + platforms = lib.platforms.unix; + maintainers = [ ]; + }; +}