CapEx vs OpEx deals with how the equipment is managed financially. Buy vs lease/rent/IAAS. Good examples here https://centersquaredc.com/blog/choosing-the-best-data-cente...
There's some theorem about investments that says it doesn't matter how they are financed. A good one is good, and a bad one is bad, whether or not you use debt.
If you have spherical banks in a vacuum, you can simply follow "capital_opex = capex * interest_rate" and then "profit = revenue - total_opex".
But things tend to not work that way on practice.