This should be possible by shelling out to nix-instantiate and collecting derivation paths. I'd imagine there would be a built-in function like:
---Import derivations from Nix.
---@param ... string[] A list of Nix flake installables
---@return table<string, derivation>
function nixInstallables(...) end