Nixos install and right away reboot and update -> collision between `/nix-bash-completions-0.6.8/share/bash-completion/completions/nixos-container'

I installed nixos via iso / usb

nix-build '<nixpkgs/nixos>' -A config.system.build.toplevel -I nixos-config=/mnt/etc/nixos/configuration.nix
nixos-install

before doing anything
I updated nix-channel --update
and
started nixos-rebuild build --show-trace


Why is the result a collision

  • how could I omit that?
    (there was nothing done but install and straight update - I would not expect a collision to happen)
root@nixos:/home/ae]# nix-channel --update 
unpacking channels...
created 1 symlinks in user environment

[root@nixos:/home/ae]# nixos-rebuild build --show-trace 
building Nix...
building the system configuration...
these derivations will be built:
  /nix/store/h5aswrpd1339vr4mxqimp43aawgyy7py-nixos-version.drv
  /nix/store/mpx3pxk3jnmrmcprqx5vkjs01r9ncfq3-system-path.drv
  /nix/store/6frs4ipbg40qmlxmpm9klssdhbr4wsyi-dbus-1.drv
  /nix/store/yy79ifx8nfp6cdlg2i2i6w1a738cqgcb-unit-dbus.service.drv
  /nix/store/bmv0qbrx7allc87ziji0573wbzrcvvgd-user-units.drv
  /nix/store/f3gflmx7q3l45m6ibqjmysw48p4mlr4v-unit-systemd-fsck-.service.drv
  /nix/store/phvq4kkhdpjvfhy7fx9948bfppfkjfp0-unit-dbus.service.drv
  /nix/store/r5xjwyr8dhisffhi3s6h1faqhv3gvgik-unit-polkit.service.drv
  /nix/store/bzqpjsfdzdnj01kg70axv8yk4h3x00kz-system-units.drv
  /nix/store/d923clp61anak95y4k6w1n0g557dz82k-etc-os-release.drv
  /nix/store/xp8jz6j892m8zx5j9b03b9cfwxs6bc0y-issue.drv
  /nix/store/x7v8rigr8ahcyh7n9a52kw91alad206r-etc.drv
  /nix/store/ckyxxkck5dw41hnzld33sf3v7y820kxv-nixos-system-nixos-21.05.1523.b2f87e0043a.drv
building '/nix/store/d923clp61anak95y4k6w1n0g557dz82k-etc-os-release.drv'...
building '/nix/store/xp8jz6j892m8zx5j9b03b9cfwxs6bc0y-issue.drv'...
building '/nix/store/h5aswrpd1339vr4mxqimp43aawgyy7py-nixos-version.drv'...
building '/nix/store/mpx3pxk3jnmrmcprqx5vkjs01r9ncfq3-system-path.drv'...
collision between `/nix/store/cnsamh3ww6mvx13i41x84515lww2g7fh-nix-bash-completions-0.6.8/share/bash-completion/completions/nixos-container' and `/nix/store/mn1r6h0hb6l504w9l2v86mdh0qaz5vp4-nixos-container/share/bash-completion/completions/nixos-container'
created 28898 symlinks in user environment
gtk-update-icon-cache: Cache file created successfully.
building '/nix/store/6frs4ipbg40qmlxmpm9klssdhbr4wsyi-dbus-1.drv'...
building '/nix/store/r5xjwyr8dhisffhi3s6h1faqhv3gvgik-unit-polkit.service.drv'...
building '/nix/store/f3gflmx7q3l45m6ibqjmysw48p4mlr4v-unit-systemd-fsck-.service.drv'...
building '/nix/store/phvq4kkhdpjvfhy7fx9948bfppfkjfp0-unit-dbus.service.drv'...
building '/nix/store/yy79ifx8nfp6cdlg2i2i6w1a738cqgcb-unit-dbus.service.drv'...
building '/nix/store/bzqpjsfdzdnj01kg70axv8yk4h3x00kz-system-units.drv'...
building '/nix/store/bmv0qbrx7allc87ziji0573wbzrcvvgd-user-units.drv'...
building '/nix/store/x7v8rigr8ahcyh7n9a52kw91alad206r-etc.drv'...
building '/nix/store/ckyxxkck5dw41hnzld33sf3v7y820kxv-nixos-system-nixos-21.05.1523.b2f87e0043a.drv'...

@jonringer is this expected behavior of nixos?

This is the issue, both of these packages have completionso for nixos-container, and nix doesn’t know which one should “win”.

I would cc the maintainer of those packages to see which on should be preferred, and give that derivation a higher priority

I get the same collision when doing a fresh install from Debian+Nix to a new partition using nixos-install. I have no idea how to set package priorities. I have also no idea why this happens in a fresh installation. Wouldn’t this affect every NixOS user?