Better detect when `buildPaths` would be a no-op
Better detect when `buildPaths` would be a no-op

`buildPaths` can be called even for stores where it's not defined in case it's
bound to be a no-op.
The “no-op detection” mechanism was only detecting the case wher `buildPaths`
was called on a set of (non-drv) paths that were already present on the store.

This commit extends this mechanism to also detect the case where `buildPaths`
is called on a set of derivation outputs which are already built on the store.

This only works with the ca-derivations flag. It could be possible to
extend this to also work without it, but it would add quite a bit of
complexity, and it's not used without it anyways.

rycee/nix,NixOS/nix,rycee/nix,rycee/nix,NixOS/nix,NixOS/nix,NixOS/nix,rycee/nix,NixOS/nix,rycee/nix