On collisions: natural way of life or bogus configuration?

Hi all,

Are collisions like this a normal way of life in NixOS or do they occur because of some configuration issues in my configurion.nix? Looks like it is all due to bind-9.20.15:

pkgs.buildEnv warning: colliding subpath (ignored): `/nix/store/3kwpwqqc49ldqrfvg3xd3xq4mq1jmjg9-bind-9.20.15-man/share/man/man1/dig.1.gz' and `/nix/store/k3rcsfzmqsb94qbf61iw518g09karidf-bind-9.20.15-man/share/man/man1/dig.1.gz'
pkgs.buildEnv warning: colliding subpath (ignored): `/nix/store/3kwpwqqc49ldqrfvg3xd3xq4mq1jmjg9-bind-9.20.15-man/share/man/man1/delv.1.gz' and `/nix/store/k3rcsfzmqsb94qbf61iw518g09karidf-bind-9.20.15-man/share/man/man1/delv.1.gz'
pkgs.buildEnv warning: colliding subpath (ignored): `/nix/store/3kwpwqqc49ldqrfvg3xd3xq4mq1jmjg9-bind-9.20.15-man/share/man/man1/mdig.1.gz' and `/nix/store/k3rcsfzmqsb94qbf61iw518g09karidf-bind-9.20.15-man/share/man/man1/mdig.1.gz'
pkgs.buildEnv warning: colliding subpath (ignored): `/nix/store/3kwpwqqc49ldqrfvg3xd3xq4mq1jmjg9-bind-9.20.15-man/share/man/man1/named-checkconf.1.gz' and `/nix/store/k3rcsfzmqsb94qbf61iw518g09karidf-bind-9.20.15-man/share/man/man1/named-checkconf.1.gz'
...

After the rebuild switch is done, I don’t see anything referring to the LHS of the collision:

$ nix-store --query --referrers /nix/store/k3rcsfzmqsb94qbf61iw518g09karidf-bind-9.20.15-man/share/man/man5/named.conf.5.gz
/nix/store/a2j2k6pwqiq8rxbashr6pfnsmi2bryw8-system-path
/nix/store/dsmskqdxyki7lagcharys86l2f8b5sw5-system-path
/nix/store/l12ng5ynr1l065nckl7v4z1gqjphjgjp-man-paths
/nix/store/mdpdnnb5afh0iklw3k6604l35krzk7sh-system-path
/nix/store/ydk8gd1i45wkcalim3g6p9f8d7kpfm04-system-path

$ nix-store --query --referrers /nix/store/3kwpwqqc49ldqrfvg3xd3xq4mq1jmjg9-bind-9.20.15-man/share/man/man5/named.conf.5.gz

So I don’t know how to pinpoint the root cause.

Thanks in advance.

It seems like you’re installing 2 different variations of bind (same version, but the different hashes indicate something is different about them).

Look into what you put into environment.systemPackages and consider if a module you use might also be adding something conflicting to it.

2 Likes

I don’t have bind there specified, but I did some digging (no pun intended), and looks like dig is causing this.

EDIT:

Removing dig fixed the issue:

$ nix show-derivation /nix/store/9vgbi2p9dhkc7gp0z90p6vwmfw4w49ba-bind-9.20.15.drv | jq '."/nix/store/9vgbi2p9dhkc7gp0z90p6vwmfw4w49ba-bind-9.20.15.drv".env.NIX_MAIN_PROGRAM'
"dig"

But now how can I dig?

1 Like

I’d say to add (lib.hiPrio pkgs.bind) - instead of pkgs.dnsutils or pkgs.bind - to environment.systemPackages.
The higher-priority package will win out and avoid said collision.

For context, the reason for the collision is this:

host is bind^host and dig is bind^dnsutils.
So there’s some overlap.
Hence I’m suggesting to just use bind directly and let it install all its default outputs:

2 Likes

Thanks heaps! It worked.

And as I didn’t have dnsutils or dig in my configuration.nix, it worked even without (lib.hiPrio pkgs.bind).