-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
nix profile remove and upgrade accept an regexp argument to be able to match specific (or ranges of) packages. This usually results in confusion. Some common errors that people can run into:
Forgetting quotation in most shells:
$ nix profile remove .*vim.*
fish: No matches for wildcard '.*vim.*'. See `help wildcards-globbing`.
nix profile remove .*vim.*
^~~~~~^$ nix profile remove .*vim.*
zsh: no matches found: .*vim.*Using wildcards instead of regexp result in confusing error message:
$ nix profile remove '*vim*'
error: Mismatched '(' and ')' in regular expressionWhich ( and )?
Forgetting regexp and wildcards altogether:
$ nix profile remove vim
warning: 'vim' does not match any packages
warning: Use 'nix profile list' to see the current profile.This makes it seem like vim was not installed at all, but it just wasn't matched by the regexp vim, because it should match flake:nixpkgs#legacyPackages.x86_64-linux.vim.
I'm thinking nix profile should only optionally accept regexp and it should be very explicit about it. For instance --regex "your regex". It shouldn't be the default to match packages.
Reactions are currently unavailable