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] Changes to support format changes from nix 2.20 (#1770)
## Summary
The latest nix version (2.20) changed how the nix profile output is
represented:
From the [release
notes](https://nixos.org/manual/nix/stable/release-notes/rl-2.20):
> nix profile now allows referring to elements by human-readable names
NixOS/nix#8678
> [nix
profile](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile)
now uses names to refer to installed packages when running
[list](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile-list),
[remove](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile-remove)
or
[upgrade](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile-upgrade)
as opposed to indices. Profile element names are generated when a
package is installed and remain the same until the package is removed.
> Warning: The manifest.nix file used to record the contents of profiles
has changed. Nix will automatically upgrade profiles to the new version
when you modify the profile. After that, the profile can no longer be
used by older versions of Nix.
and for `nix search`:
> Disallow empty search regex in nix search
[#9481](NixOS/nix#9481)
> [nix
search](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-search)
now requires a search regex to be passed. To show all packages, use ^.
TODOs:
- [x] update `nix.readManifest` to handle the new format
- [x] `nix search` requires a regex to be passed
- [x] manually test on nix < 2.20 on devbox.sh to verify the older nix
still works
Fixes#1767
## How was it tested?
CICD should pass
Installed nix 2.20.1 locally and am using Devbox with it to add, remove
packages and run scripts and shell.
verified flake updating works:
1. `examples/flakes/remote`. Did `devbox shell`, dropped the `v0.43.1`
from process-compose flake, did `devbox update`, and verified that
`process-compose` now had the latest version (IIRC `0.80+`)
2. `examples/flakes/php`. Did `devbox shell`, edited the flake to drop
`ds` and did `devbox update`. Verified no `ds` in `php -m | grep ds`
0 commit comments