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
[nix.System] call EnsureNixInstalled from devbox.Open, and cleanup function API (#1374)
## Summary
`nix.System` is widely used. So, in #1357 we wanted to change its API to
just
return `string` instead of `string, error`.
To do so, we cache the result in a `nix` package variable. And populate
it
during `EnsureNixInstalled`.
However, `EnsureNixInstalled` was only called from Cobra command
functions. But
`devbox` as a library also now needs to call it. IMO, it should always
have called
it since we do rely on `nix` being installed. This PR adds this.
It also fixes up the API to:
`System: string` and `ComputeSystem: (string, error)`.
NOTE: inside `System`, I still do a best-effort to avoid panic by
calling
`ComputeSystem`. This can happen in edge-cases like some tests
`generate_test/TestWriteFromTemplate`
that exercise internal functions reliant on `nix.System` without calling
`devbox.Open`.
## How was it tested?
tests should pass
0 commit comments