A derivation takes lots of arguments but only one of them, builder, is executable right?
And nix-shell doesn't really execute the builder, which means there's no way of running commands such as export PATH=....
But I found some other derivations provide their virtual shell environment in which PATH is arbitrarily set e.g .env attribute of haskell package derivations.
I also found that mkDerivation add buildInput packages' sub /bin directory to PATH if exists.
How do they do that? Is there some special argument to built-in derivation function that enables you to run custom commands when evaluating?