Add NixOS package
Open 💬 20 comments Opened Apr 17, 2025 by JackPala
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
There appears to be no NixOS Package available. Currently willing to write one if there are others interested in using it.
20 Comments
Yes, count us interested!
Cool, I created a currently functional .nix config that can be imported into a user's configuration.nix via imports
This allows codex to run on NixOS, but it is not a true Nix package. I will see what processes are required for nix package repo approval
@tibo-openai Do you guys do grants for OS package development? I'd be happy to build and maintain it, starting on Nix unstable and moving into the next versioned nix branch from there.
@tibo-openai Here is a functional codebase for a starting point, it is by no means a full nix package, but it does work as a starter
https://github.com/JackPala/OpenAI-Codex-NixOS
Looks like a nix integration for dev is also implemented in https://github.com/openai/codex/pull/225, thoughts on the implementation there? Feel free to comment.
@tibo-openai That appears to be a nix flake implementation which is useful for users who use flakes.
My implementation does not require flakes and is designed for environments without flake support
@JackPala I'm having trouble getting codex building with
buildingNpmPackage. I'm getting an error about a missing package.json:I tried generating a lock file with
npm install --package-lock-only @openai/codexthen referencing that in thepostPatchstep but I'm getting further errors:I don't have much experience with javascript + nix. Do you know whats going wrong?
Well, you are unlucky, they updated the project using pnpm about two days ago, but the above nix codes used
buildNpmPackagewhich needs package-lock.json.You can check the document here.
Notice:
@MSDimos @solomon-b You'll need to get the latest hash and swap it out, the way I built it is really quick and janky. That hash changes with every commit, so if the post a commit it will change the hash of the repo and make it not work.
I have not found a way around this yet, as NixOS really likes the use of hashes to validate the repo when yanking it.
If anyone has any ideas on how to safely get around the hash, I can take a look and try to help.
Thank you @MSDimos. I had to change the
sourceRootas the lock file is in the root of the repo and wrap the cli tool to run it with node. Here is a currently working version:there is a codex package in nixpkgs apparently but its 2 versions out of date pretty consistenly what are you all doing, would be nice to make this repo a flake and then i could just pull from that like i do w ghostyy
EDIT: there seems to be a flake in the repo ill try that
Created a nix flake that is always up-to-date(automated)
https://github.com/sadjow/codex-nix/
There is a nix package, but it is outdated.
https://search.nixos.org/packages?channel=unstable&query=codex
You can use the package from numtide:
nix profile install github:numtide/nix-ai-tools#codexit would also be nice if the included flake is fixed (https://github.com/openai/codex/issues/3453)
yes it is outdated right now. cc @tibo-openai or anyone else looking at this, would love to use Nix instead of homebrew etc. for keeping my codex updated :)
https://github.com/sadjow/codex-nix
Em sáb., 4 de out. de 2025 às 18:26, dionysuz @.***>
escreveu:
ya lowkey embarrassing af that they have taken so long and not made or accepted any prs for nix integration
This has a scanning rate that’s 12 times slower than the one below.
If you want to stay up-to-date with the latest features daily I recommend the one below.
Numtide is respected organisation, more stars, contributors etc:
https://github.com/numtide/llm-agents.nix
I personally trust it more (especially for such power tools as agents).
Would be nice if it ends up here:
https://github.com/nix-community/
Ditto. I'd like to see a NixOS package as well. FYI: I'm using
home-manager. Please do include one. Would be lovely to see an official package make its way in.