Homework / test. Thevenin equivalent
@Mylane, are you trying to solve for Vin by only doing Thevenin or will you like to solve for Vin in multiple ways? 

Here is one way without doing Thevenin Equivalent:

The voltage across the 6 ohm and 4 ohm resistors together is the same voltage as 3Vx. Vx is the same voltage across 4 ohms resistor.

Going anticlockwise in the last loop with Ohm's Law (V = I*R):

-3Vx + 6ip + Vx = 0

6ip = 3Vx - Vx

ip = 2Vx/6

= Vx/3

Since the 6 ohm and 4 ohm resistors are in series, they have the same current flowing through them

Thus Vx = 4 x ip (Ohm's Law)

Let's call the current going DOWN (not UP) thru 2 ohm and 12 ohm resistors since they are in series i2

So when adding the current at the 12 ohm and 1 Amp Current Source node, (assuming all positive currents are leaving that node)

-1/2ip - i2 + 1A = 0

i2 = 1 - 1/2ip

Thus the voltage across the 2 ohm resistor, let's call that V2

Using Ohm's Law V2 = 2 * i2

Looking at the middle upper loop, 

Going clockwise with Ohm's Law (V = I*R):

-Vin - V2 - 8v + 6ip = 0

Vin = 6ip - V2 - 8v

Vin = 6ip - (-3ip) - 8v

Vin = 9ip - 8v

For some reason everything seems to cancel each other out. Did you make up this circuit yourself or was it given to you?