jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
7.83k stars 187 forks source link

nixcache: don't check Jetify caches if they're not configured #2096

Closed gcurtis closed 1 month ago

gcurtis commented 1 month ago

Don't check the Jetify Nix caches for store paths if Nix isn't configured to use them. This can happen if the user says "no" to the confirmation prompt for cache setup. Otherwise, nix build prints an error about the path missing:

$ devbox add mongodb@6.0.15
Info: Adding package "mongodb@6.0.15" to devbox.json
? You're logged into a Devbox account that now has access to a Nix cache. Allow Devbox to configure Nix to use the new cache (requires sudo)? No
Info: Skipping cache setup. Run `devbox cache configure` to enable the cache at a later time.
Info: Installing the following packages to the nix store: mongodb@6.0.15
error: path '/nix/store/n7fkj8vif9yc1g063r0z88j5dh3i7p8a-mongodb-6.0.15' is required, but there is no substituter that can build it