Strange warnings during rebuild switch: NixOS 2305

Getting weird errors or warnings during the rebuild switch

warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/mcaptest' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/mcaptest'
warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/avinfo' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/avinfo'
warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/gatttool' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/gatttool'
warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/bluetooth-player' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/bluetooth-player'
warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/mesh-cfgtest' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/mesh-cfgtest'
warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/hcieventmask' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/hcieventmask'
warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/bluetoothctl' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/bluetoothctl'
warning: collision between `/nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/cltest' and `/nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/cltest'

There’s a lot more, but it’s based around similar warnings, but rebuild switch finishes with no errors. Do i uninstall bluez-5.66? I’m not sure whats happening. i also used unstable channel to get bluetooth running

1 Like

For some reason your system pulls in two different build of bluez-5.66 and nix warns you that e.g. bluetoothctl is found in both, but it can map only one to your /run/current-system/sbin.
Tn this case this is likely no issue[1], but may be if you see this for different programs/versions.

[1] almost all files are identical, as you can see with sha256sum /nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/sbin/* /nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/sbin/* | sort

1 Like

Not sure what your asking me to try here?

i have the following in my configuration.nix:

environment.systemPackages = with pkgs; [
    # Failed : bluezUtilities

#* Enable Bluetooth
  hardware.bluetooth.enable = true;
  services.blueman.enable = true;

Do i uninstall one of them?

Well, this is “only” a warning and if your case can probably just ignored.

If you want to fix it, you can run

nix-store --query --referrers-closure /nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/
nix-store --query --referrers-closure /nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/

to get all closures where each of the store paths is involved or work you way down using

nix why-depends /run/current-system /nix/store/fgxxr36bflzyriqn3yx2zn1hfsh494gq-bluez-5.66/
nix why-depends /run/current-system /nix/store/9cb53mil9r94gv7hq2baaf9b2nk7yzbk-bluez-5.66/

This might show that you don’t have to list bluez explizitly, because it is already pulled in as a dependency or that both versions of bluez are pulled in as dependencies.

Thank you for the tip, Wamserma!

It’s amazing to see what specific things do!

Unfortunately, neither worked, and I ended up with a screen full of outputs and no idea what I was supposed to do!

After reading the Nix wiki, I decided to try sudo nix-env —upgrade and now I don’t get any unusual warnings!

Well, here is your problem. If you install two different variants of the same package you get a conflict.

And you are actually installing it a third time

So if you want to use bluez with experimental features enabled, you would just use the following option, rather than listing it in environment.systemPackages explicitly:

services.bluetooth.package = pkgs.bluez5-experimental;

Amazing info. But let me see if I understand all of that :smile:. So what you’re telling me is to remove the bluez?:

environment.systemPackages = with pkgs; [

Remove : hardware.bluetooth.enable = true; and only use this one liner, services.bluetooth.package = pkgs.bluez5-experimental; in the configuration.nix file?

Please clarify if that is what I need to do.

All I need is the normal Bluetooth that comes with Plasma, like other Plasma distros. When i first did a fresh install it would not detect any bluetooth until i added all of those packages etc

  1. Keep hardware.bluetooth.enable = true; since that is what is required to actually have Bluetooth support.
  2. Remove bluez from environment.systemPackages since that is already done by hardware.bluetooth.enable = true.
  3. Remove bluez5-experimental from environment.systemPackages since it would conflict with bluez installed by hardware.bluetooth.enable = true.
  4. Add services.bluetooth.package = pkgs.bluez5-experimental; if you need experimental Bluez features. If you do not know, you probably do not need them.

Ok. Trying now and report back afterwards. Cheers

The way most NixOS modules work is that they have enable option that defaults to false and when it is not enabled, other options in the module will not have any effect. That is also the case here:

Sorry to be a pain. Just noticed i had all of these in there:

environment.systemPackages = with pkgs; [
    # Failed  bluezUtilities
    bluez5-experimental    <---- REMOVE

Also I may have this all wrong or acutally screwed everything up, but I have all my programs that i want in the environment section, do i add them in to here instead?

packages = with pkgs; [

Those are programs for managing Bluetooth devices. Unless you want them, you can just remove them. Plasma will install their own utilities when you enable Bluetooth support:

packages is not a NixOS option, most of the time you are fine installing programs with environment.systemPackages. System components are bit different because they might need other configuration so specific NixOS option might exist.

The general rule of thumb is:

  • Search for an option first. If one exists, use it. If a specific option does not exist, use environment.systemPackage.

This is because when a module exists, it is probably because environment.systemPackage is not sufficient to install the software (it requires e.g. setting up users, creating directories in /etc or depends on other services).

On top of that:

  • Avoid mixing the two installation (another example where it went wrong).
  • Keep in mind that some modules might enable other modules (e.g. GNOME desktop environment will enable bluetooth and other system components out of the box) so even if you do not enable a module explicitly, you might have done it implicitly.