What you did is "quite" correct, you'll probably just have to find the right transformation parameters for your scene. But with this kind of setup it's not easy to figure them out.
I see you are using a Diagonal Gradient texture type, but at the same time you are also rotating the input coordinates, so as you are rotating something that is already rotated... well, it's easy to get lost.
I would suggest to use a simpler node tree, based on a Linear type, that lead to a behaviour that it's easier to predict, like the floowing.
But my real suggestion would be to use use an Empty to control the Texture Coordinates for the Gradient. This way you'll be able to visually adjust the orientation, the location and the scale of the texture.
Use the Arrows empty's type and remember that the texture lays in the XY plane (so empty's Z axis sould point toward global X).
Here's the shader in action: