OpenAI Codex CLI for NixOS and Nix users.
# flake.nix
{
  inputs.openai-codex-nix.url = "github:GutMutCode/openai-codex-nix";
  outputs = { openai-codex-nix, ... }: {
    homeConfigurations.user = {
      modules = [
        openai-codex-nix.homeManagerModules.default
      ];
      home.packages = [ pkgs.openai-codex ];
    };
  };
}# Then rebuild and run
codex --versionFor home-manager:
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager.url = "github:nix-community/home-manager";
    openai-codex-nix.url = "github:GutMutCode/openai-codex-nix";
  };
  outputs = { nixpkgs, home-manager, openai-codex-nix, ... }: {
    homeConfigurations."user@hostname" = home-manager.lib.homeManagerConfiguration {
      modules = [
        openai-codex-nix.homeManagerModules.default
        {
          home.packages = [ pkgs.openai-codex ];
        }
      ];
    };
  };
}For NixOS:
{
  inputs.openai-codex-nix.url = "github:GutMutCode/openai-codex-nix";
  outputs = { openai-codex-nix, ... }: {
    nixosConfigurations.hostname = {
      modules = [
        openai-codex-nix.nixosModules.default
        {
          environment.systemPackages = [ pkgs.openai-codex ];
        }
      ];
    };
  };
}{
  inputs.openai-codex-nix.url = "github:GutMutCode/openai-codex-nix";
  nixpkgs.overlays = [ openai-codex-nix.overlays.default ];
  home.packages = [ pkgs.openai-codex ];
}# Temporary shell
nix shell github:GutMutCode/openai-codex-nix
# Install to profile
nix profile install github:GutMutCode/openai-codex-nix
# Run directly
nix run github:GutMutCode/openai-codex-nix| Platform | Status | Notes | 
|---|---|---|
| x86_64-linux | ✅ | Node.js wrapper | 
| aarch64-linux | ✅ | Node.js wrapper | 
| x86_64-darwin | ✅ | Node.js wrapper | 
| aarch64-darwin | ✅ | Node.js wrapper | 
- Node.js (automatically provided)
- No additional requirements
# Start codex
codex
# Check version
codex --version
# Get help
codex --helpCurrent version: 0.50.0
This package tracks OpenAI Codex CLI releases from npm registry.
# Clone repository
git clone https://github.com/GutMutCode/openai-codex-nix
cd openai-codex-nix
# Test build
nix build
# Test run
nix run . -- --version
# Enter development shell
nix developTo update to a new version:
- Check latest version: npm view @openai/codex version
- Update versioninpackage.nix
- Get new hash: nix-prefetch-url --unpack https://registry.npmjs.org/@openai/codex/-/codex-VERSION.tgz
- Convert hash: nix hash to-sri sha256:HASH
- Update hashinpackage.nix
- Test: nix build
- This repository (Nix packaging): MIT License
- OpenAI Codex CLI: Apache-2.0
OpenAI Codex CLI is open source software by OpenAI. This repository only provides Nix packaging.
Contributions welcome! Please:
- Test on your platform
- Update version in both package.nix and README
- Verify hash matches
- Run nix flake check