You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #4665 ; i'd like codex to be able to run a command with a PATH environment that I provide it. Currently, in a nix project, codex seems to be unable to run basic compiler tasks because it cannot enter the nix environment.
@Meowzz95 No, my issue is that nix-shell or the equivalent will load a shell with all my tools for the given project. if I launch codex, codex does not have access to that shell. Codex is not allowed to invoke that shell and, though nix is fast all things considered, it should not reload the shell every time it needs to check the compiler output.
the shell policy should default to all but apparently codex does not take the ambient PATH at execution because it doesn't have any of the tools, including nix-shell:
• Ran cabal test tests
└ Error: cabal: Could not resolve dependencies:
[__0] trying: foo-0.1 (user goal)
… +7 lines
goals I've had most trouble fulfilling: base, snap-stream, foo
• Ran nix-shell --command 'cabal test tests'
└ bash: line 1: nix-shell: command not found
> nix-shell isn’t available in this environment (command not found), so the combined command can’t run. If you have Nix installed elsewhere, you could
invoke the same command there; otherwise we’ll need another way to get the right GHC/base version.
This policy might be able to do something if I could populate it from the given path during the nix shell evaluation:
Activity
github-actions commentedon Oct 3, 2025
Potential duplicates detected:
Powered by Codex Action
Meowzz95 commentedon Oct 4, 2025
Are you looking for
https://github.com/openai/codex/blob/main/docs/config.md#sandbox_mode
search for
writable_rootso1lo01ol1o commentedon Oct 4, 2025
@Meowzz95 No, my issue is that
nix-shellor the equivalent will load a shell with all my tools for the given project. if I launch codex, codex does not have access to that shell. Codex is not allowed to invoke that shell and, though nix is fast all things considered, it should not reload the shell every time it needs to check the compiler output.the shell policy should default to
allbut apparently codex does not take the ambient PATH at execution because it doesn't have any of the tools, includingnix-shell:This policy might be able to do something if I could populate it from the given path during the nix shell evaluation:
[shell_environment_policy]
inherit = "all"
set = { PATH = "$NIX_SHELL_PATH" }
But that's already a bit more janky then just passing through the PATH to
codexetraut-openai commentedon Dec 18, 2025
This feature request hasn't received any upvotes or additional posts in over two months, so I'm going to close it out.