Windows app hard-codes /usr/bin/bash, preventing WSL agent from running on NixOS

Open 💬 1 comment Opened Jul 21, 2026 by anghel4d

What version of the Codex App are you using?

26.715.7063.0 (Windows x64)

The Codex CLI installed inside NixOS is codex-cli 0.144.4.

What platform is your computer?

Windows with WSL2, using NixOS:

NixOS 26.11.20260718.61b7c44 (Zokor)

What issue are you seeing?

The Windows Codex app cannot start the agent in the NixOS WSL distribution because its WSL launcher hard-codes /usr/bin/bash.

NixOS intentionally does not use the conventional FHS location /usr/bin/bash. Bash is installed and works normally at:

$SHELL=/run/current-system/sw/bin/bash
/bin/bash
/sbin/bash
/run/current-system/sw/bin/bash

The installed Codex app bundle constructs its WSL command in this form:

wsl.exe -d <distribution> -- /usr/bin/bash -lc <command>

It then classifies exit code 127 containing /usr/bin/bash: not found as an unsupported WSL shell. Consequently the Settings flow reports that Codex cannot run in the current WSL distribution even though Bash and the Codex CLI are both installed and functional.

What steps can reproduce the bug?

  1. Install a NixOS WSL2 distribution.
  2. Install bash and codex normally through the NixOS configuration.
  3. Confirm that bash and codex are on PATH, but /usr/bin/bash is absent.
  4. In the Windows Codex app, select WSL as the agent environment and choose the NixOS distribution.
  5. Restart the app.

The hard-coded launch fails:

wsl.exe -d NixOS -- /usr/bin/bash -lc 'codex --version'
# bash: line 1: /usr/bin/bash: No such file or directory

Using NixOS's valid Bash path succeeds:

wsl.exe -d NixOS -- /bin/bash -lc 'codex --version'
# codex-cli 0.144.4

What is the expected behavior?

The WSL launcher should not require Bash at the FHS-specific path /usr/bin/bash.

It should resolve bash from the WSL distribution's PATH, use the user's configured login shell, or otherwise discover a supported shell before launching Codex. NixOS WSL should be accepted when Bash and Codex are available.

Workaround

Creating the following compatibility symlink makes the current app launcher work:

/usr/bin/bash -> /bin/bash

This confirms that the hard-coded path is the only blocker in this reproduction.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗