Repository navigation
Description
Description
The Nix-built devcontainer image (dockerTools.buildLayeredImage, flake.nix packages.devcontainerImage) does not provide /usr/bin/env — in fact /usr/bin does not exist at all. env is only available at /bin/env.
The canonical portable shebang #!/usr/bin/env <interp> (used by virtually every Node, Python, Ruby, etc. CLI) therefore fails inside the image. This blocks essentially every Node/TypeScript (and many other) downstream consumers running in devcontainer/image mode.
Discovered while live-testing the migration against the commit-action consumer.
Steps to Reproduce
just build(loadsghcr.io/vig-os/devcontainer:dev).- Run a Node/TS project in the image, e.g.:
podman run --rm -v <commit-action>:/workspace/commit_action -w /workspace/commit_action \ ghcr.io/vig-os/devcontainer:dev bash -lc 'npm ci && npm run build' - Observe
tsc(and any localnode_modules/.bin/*) fail.
Expected Behavior
/usr/bin/env exists, so #!/usr/bin/env node (and other interpreters) resolve and locally-installed CLIs run.
Actual Behavior
sh: /workspace/commit_action/node_modules/.bin/tsc: /usr/bin/env: bad interpreter: No such file or directory
$ ls -l /usr/bin/env # No such file or directory (/usr/bin does not exist)
$ ls -l /bin/env # /bin/env -> coreutils
Confirmed fix in-container: after mkdir -p /usr/bin && ln -sf /bin/env /usr/bin/env, npm run build succeeds and the full commit-action Jest suite passes (80/80).
Environment
- OS: NixOS (host); image is hermetic Nix (no base distro)
- Container Runtime: Podman 5.8.2
- Image Version/Tag:
dev(locally built fromfeature/625-nix-claude-migrationviajust build) - Architecture: AMD64
Additional Context
Part of the Nix migration master issue #625 / image task #634. Likely a hard blocker for the publish-cutover (#639). Distinct from #687 (which is about #!/bin/bash in host scripts).
Possible Solution
Add the standard /usr/bin/env (and /usr/bin, /bin/sh) symlinks in the image. nixpkgs dockerTools provides helpers exactly for this — include pkgs.dockerTools.usrBinEnv (and binSh) in the image contents, or add an extraCommands/fakeRootCommands step that symlinks usr/bin/env -> /bin/env.
Changelog Category
Fixed
Activity
fix(image): add /usr/bin/env to the Nix-built image (#730)
fix(image): bake writable on-PATH npm global prefix (#734)
chore(changelog): re-sync workspace CHANGELOG mirror
c-vigo commentedon Jun 30, 2026
Resolved by #730 (f5679cd) on the Nix-migration branch (epic #625, PR #670). Closing as part of post-merge backlog hygiene (#677).
chore: release 0.4.0 (#195)
chore: release 0.4.0 (#813)