-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
The "nix profile" command allows installing duplicate packages, which isn't what I expected (nix-env would reject this).
It does seem to check for conflicting binaries/files among different packages (two versions of bash, for example).
This bug is about having duplicate identical installation items, which at least seems unlikely to be intentional and easy enough to check for (I'm seeing some profile-related bits having custom operator <'s that look likely to be useful for catching at least these trivially duplicate entries?).
Steps To Reproduce
nix profile install --profile ~/test-profile nixpkgs#bashnix profile install --profile ~/test-profile nixpkgs#bashnix profile list --profile ~/test-profile- Observe duplicates in output:
0 flake:nixpkgs#legacyPackages.x86_64-linux.bash github:NixOS/nixpkgs/80e6ae766ae5d928da056dee74b747660f6c1178#legacyPackages.x86_64-linux.bash /nix/store/svxmj4xahyjqq4lciisvgi1fwl5bxpdd-bash-5.1-p8
1 flake:nixpkgs#legacyPackages.x86_64-linux.bash github:NixOS/nixpkgs/80e6ae766ae5d928da056dee74b747660f6c1178#legacyPackages.x86_64-linux.bash /nix/store/svxmj4xahyjqq4lciisvgi1fwl5bxpdd-bash-5.1-p8
Expected behavior
Reject attempt to install duplicate package. Or silently keeping the first, so one can install same items repeatedly without worrying about what's already installed.
nix-env --version output
nix-env (Nix) 2.5pre20211007_844dd90
EDIT: updated after testing conflict handling among different packages