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
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, but may be if you see this for different programs/versions.
 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
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).
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.