Run a program using NVIDIA dedicated GPU only when plugged into power
Unfortunately, the requested configuration is unsupported.
The only company that allows such setup options would be AMD's Enduro implementation which allows GPU selection based on power supply.