[Nix-dev] Collisions

James Cook james.cook at utoronto.ca
Sun Mar 5 02:06:28 CET 2017


On 4 March 2017 at 11:56, Mark Gardner <mkg at vt.edu> wrote:
> I am having a bunch of collisions between files in different packages:
>
> collision between
> `/nix/store/0n3z27bqv701g6rziqvr75nkixhsbnx1-traceroute-2.1.0/bin/traceroute'
> and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/bin/traceroute'
> collision between
> `/nix/store/bbx92cl3rj4k5vyicsiqjycrf799v5qh-iputils-20151218/bin/ping6' and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/bin/ping6'
> collision between
> `/nix/store/bbx92cl3rj4k5vyicsiqjycrf799v5qh-iputils-20151218/bin/ping' and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/bin/ping'
> collision between
> `/nix/store/0csldllszg77wyrqzj4kn042pnfjci1v-net-tools-1.60_p20120127084908/bin/ifconfig'
> and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/bin/ifconfig'
> collision between
> `/nix/store/0csldllszg77wyrqzj4kn042pnfjci1v-net-tools-1.60_p20120127084908/bin/dnsdomainname'
> and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/bin/dnsdomainname'
> collision between
> `/nix/store/0csldllszg77wyrqzj4kn042pnfjci1v-net-tools-1.60_p20120127084908/bin/hostname'
> and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/bin/hostname'
> collision between
> `/nix/store/0csldllszg77wyrqzj4kn042pnfjci1v-net-tools-1.60_p20120127084908/share/man/man1/dnsdomainname.1.gz'
> and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/share/man/man1/dnsdomainname.1.gz'
> collision between
> `/nix/store/0csldllszg77wyrqzj4kn042pnfjci1v-net-tools-1.60_p20120127084908/share/man/man1/hostname.1.gz'
> and
> `/nix/store/g4jyf4l8zg6rs0mj01h4cm16vq43655m-inetutils-1.9.4/share/man/man1/hostname.1.gz'
>
> In the first case, uninstalling the traceroute package, which only has the
> traceroute command, and leaving inetutils, which has traceroute and other
> commands, will solve the problem. But what about the need to have both
> net-tools and inetutils installed to get all the commands in both packages
> at the same time? What about iputils and inetutils?
>
> I searched the archives and found "[Nix-dev] collision detection"
> http://lists.science.uu.nl/pipermail/nix-dev/2004-November/000008.html. But
> I didn't see a resolution to the problem. What is the correct way to solve
> this?

The usual solution is to give the packages different priorities. Then
when there is a collision, the path that collided will come from the
package with the lower priority value.

If you use nix-env to install packages, this example from the nix-env
man page gives binutils precedence over gcc:
  $ nix-env --set-flag priority 5 binutils
  $ nix-env --set-flag priority 10 gcc

If you install things another way (e.g. via
/etc/nixos/configuration.nix) then it's also possible to set
priorities; I think the meta.priority attribute is involved.

James


More information about the nix-dev mailing list