It’s deterministic after all, so test against the full thing for greater
flexibility in testing and confidence in lack of unexpected changes to
previously-untested parts of the default $PATH.
Do this in a subshell to avoid polluting the test script’s environment.
This should enable `nix run` to work under shells like fish and zsh,
as well as making child shells not needlessly reset any environment
that should be inherited.
Implementation adapted from NixOS.