How do those `update-alternatives` systems work?

In nix it is done by simply calling the full path to the file. So instead of calling grep, it calls something like /nix/store/0kcx6s8gxysnygd8kxa502xfdfm1n28y-gnugrep-3.4/bin/grep. Of course, Nix has cool ways to make this easy but explaining the mechanics on all that is a bit beyond a friendly forum post. Better to read the nix docs.

3 Likes