topgrade icon indicating copy to clipboard operation
topgrade copied to clipboard

nix upgrade is broken

Open Pr0Ger opened this issue 1 year ago • 1 comments

Erroneous Behavior

Upgrade nix step is broken on nix 2.21.0 and higher

warning: Package name '.*' does not match any packages in the profile.
warning: No packages to upgrade. Use 'nix profile list' to see the current profile.

Expected Behavior

nix packages is upgraded

Steps to reproduce

  1. upgrade nix to version higher than 2.21
  2. run topgrade

Possible Cause (Optional)

https://github.com/NixOS/nix/pull/10166

topgrade is using nix profile upgrade '.*' which is no longer work as expected if nix version is higher than 2.21 topgrade should use either nix profile upgrade --regex '.*' or nix profile upgrade --all

Problem persists without calling from topgrade

  • [x] Yes
  • [ ] No

Did you run topgrade through Remote Execution

  • [ ] Yes
  • [x] No

Additional Details

  • Operation System/Version
❯ uname -a
Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:37 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6031 arm64

~ 
❯ nix --version
nix (Nix) 2.21.2
  • Topgrade version (topgrade -V) 14.0.1

Verbose Output (topgrade -v)

...
── 04:03:30 - Nix ──────────────────────────────────────────────────────────────
DEBUG Executing command `/nix/var/nix/profiles/default/bin/nix-channel --update`
unpacking 0 channels...
DEBUG Executing command `/nix/var/nix/profiles/default/bin/nix --extra-experimental-features nix-command profile upgrade '.*' --verbose`
warning: Package name '.*' does not match any packages in the profile.
warning: No packages to upgrade. Use 'nix profile list' to see the current profile.
...

Pr0Ger avatar Apr 25 '24 21:04 Pr0Ger

PR welcome if you want to give it a fix, personally I am not a Nix user

SteveLauC avatar Apr 26 '24 00:04 SteveLauC