The power cord will need to accommodate the bending and the extending - to achieve this sufficient free cord will need to be left at the hinge points.
Build the contraption and work out the cord arrangement with string. When it looks OK then fit the electric cable.
With your swing arm lamp - you are the world expert.
Google / Images may be useful
Good Luck...
November 2016