Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix profiles upgrade and remove have counter-intuitive argument #7960

Closed
bobvanderlinden opened this issue Mar 4, 2023 · 3 comments · Fixed by #8678
Closed

nix profiles upgrade and remove have counter-intuitive argument #7960

bobvanderlinden opened this issue Mar 4, 2023 · 3 comments · Fixed by #8678
Labels
bug new-cli Relating to the "nix" command

Comments

@bobvanderlinden
Copy link
Member

Using upgrade and remove is counter intuitive. The following example shows what a user will likely presume to work:

$ nix profile install github:cachix/devenv/latest
$ nix profile upgrade github:cachix/devenv/latest
warning: 'github:cachix/devenv/latest' does not match any packages
warning: Use 'nix profile list' to see the current profile.
$ nix profile remove devenv
warning: 'devenv' does not match any packages
warning: Use 'nix profile list' to see the current profile.
  • The installable used in install is not applicable to remove nor upgrade.
  • The output shows warnings, but are actually errors. Nothing has changed to the profile.
  • nix profile list is suggested, but it isn't clear that you need to pick the index from that list.
  • The name of the installable (devenv) is not applicable to remove nor upgrade. Ideally the NAME is deferred from the flake patterns (github:OWNER/NAME/VERSION, github:OWNER/REPO/VERSION#NAME, nixpkgs#NAME, github:OWNER/NAME/VERSION#default).
@bobvanderlinden bobvanderlinden changed the title nix profiles upgrade and remove have counter-intuitive UX nix profiles upgrade and remove have counter-intuitive argument Mar 4, 2023
@roberth roberth added the new-cli Relating to the "nix" command label Mar 16, 2023
@edrex
Copy link

edrex commented Mar 24, 2023

To ease my own pain here, I wrote a little interactive fzf wrapper script around the upgrade and remove subcommands:
https://github.com/edrex/nixcfg/blob/main/cmd/nix-profile

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/flakes-as-a-unified-format-for-profiles/29476/1

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/flakes-as-a-unified-format-for-profiles/29476/17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new-cli Relating to the "nix" command
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants