jetify-com / devbox

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

internal/nix: support older nix versions in DaemonVersion #2028

Closed gcurtis closed 2 months ago

gcurtis commented 2 months ago

To check if nix daemon is running, Devbox runs:

nix store info --json --store daemon

This fails on older versions of Nix for a couple reasons:

Check for both of these versions when constructing the nix store command so it works for Nix versions 2.12 - 2.21+.

Also add a nix.VersionInfo.AtLeast method and constants to make checking for supported major Nix versions easier.

Tested by running the nix store commands on all supported Nix versions.

sentry-io[bot] commented 2 months ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎