Cp in toybox doesn't work

I installed toybox to get webcam to run. Later I discovered that the version of cp in toybox would create empty files. So I pulled toybox from /etc/nixos/configuration.nix. Now I find
$ file which cp
/run/current-system/sw/bin/cp: symbolic link to /nix/store/wkncsy0h3kicp5y5hwqyqkirpa3ff5pv-coreutils-full-9.1/bin/cp

And that cp works.


  1. How should I approach getting cp in toybox fixed?
  2. How do I find out how a particular binary gets into my path? I don’t see coreutils-full in configuration.nix.

Talk to toybox upstream.

Coreutils is installed by default here. Modules you enable will often put the package they manage into environment.systemPackages as well.

You can actually explore the various definitions of an option if you evaluate your config in just the right way, but it’s different between flakes and not, and just generally not intuitive.