Skip to content

nix upgrade is broken  #782

@Pr0Ger

Description

@Pr0Ger

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)

NixOS/nix#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

  • Yes
  • No

Did you run topgrade through Remote Execution

  • Yes
  • 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.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions