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 profile list] parse using --json in new nix version (#1308)
## Summary
Problem:
Latest nix version of 2.17 changes the output format of `nix profile
list` to be:
```
Index: 0
Flake attribute: legacyPackages.aarch64-linux.curl
Original flake URL: github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb
Locked flake URL: github:NixOS/nixpkgs/3c614fbc76fc152f3e1bc4b2263da6d90adf80fb
Store paths: /nix/store/3qcvhxxmgcdj6izfs8d3m8csdlsj92ng-curl-8.1.1-bin /nix/store/6skgivna073ziw95xvbksvd5c8n5vi5w-curl-8.1.1-man
```
Previously, the "keys" didn't exist in the output. This broke how we
were parsing the output.
Fix in pseudo code:
```
try invoke: nix profile list --json
if error:
do old code: nix profile list
```
the older nix versions don't support --json
## How was it tested?
in some devbox projects:
```
# clear old state
> rm -rf .devbox
> devbox shell
# run some commands specific to that project
```
0 commit comments