Get derivation path within expression without actually evaluating

I’m trying to reference a nix derivation from within a script / Nix application.
I want to build a package without sandboxing after some setup steps ran.
To avoid some issues with race conditions and external factors like paths etc. I would like to reference the drvPath attribute of that derivation without actually buildung it (wouldn’t work at this point due to networking).
From within the nix repl drvPath seems to be available without actual building but I don’t know how to do this within an expression like the one below.
Every time I run nix run .#script, nix would start by building myPackage.

What am I missing?
Is this even possible?


myPackage = pkgs.mkDerivation {
  noChroot = true;

script = pkgs.buildShellApplication … ''
  # alternative: nix build .#myPackage
  nix eval ${myPackage.drvPath}