Move the code that calls sudo devbox into the setup package and clean it up a bit. Fix some issues that were preventing the cache from being configured in non-interactive environments (such as CI).
Don't re-prompt the user for confirmation in the sudo process.
Don't call NeedsRun a second time in the sudo process.
Don't prompt the user when stdin isn't a tty. This fixes cache configuration on macOS in CI.
Preserve Devbox environment variables such as DEVBOX_DEBUG, DEVBOX_API_TOKEN, DEVBOX_PROD, and DEVBOX_USE_VERSION. This addresses cases where the sudo devbox process would use the wrong auth or API endpoint.
Combine the nixcache aws and nix setup tasks into one task. There was a lot of overlap and this simplifies the setup code.
Move the code that calls
sudo devbox
into thesetup
package and clean it up a bit. Fix some issues that were preventing the cache from being configured in non-interactive environments (such as CI).Reran the
cache-upload
workflow against this branch and it looks like the macOS runner is able to use the cache now - https://github.com/jetify-com/devbox/actions/runs/9022662173/job/24792707507#step:5:828