bed cap brake light:
tap into your driver side brake light. to do so, you need to remove the tail light and unplug the harness. Find the white w/ green wire (iirc it's white w/ green. it's been a long time since i last did mine and when i swapped from bed rack to camper i just cut and reconnect the third brake light) and use a t-tap to tap into it and route your cap's brake light. check if it works.
if it doesn't you'll need to use a multimeter to find the correct wire.
interior lights:
run power and ground from battery under the hood along the frame and up the holes in bed. connect the led strips to a switch and switch to the wires you just ran. Don't forget to use an inline fuse and zip tie the wires to the frame. i don't like to make it in conjunction with other functions (like turns on when you open the tailgate or doors, or etc) because that's limitation. What if I want to leave the lights on for extended period of time, after the door light times out? What if I want to turn on the lights but no need to open the tailgate?
alternatively, if you are planning for more electrical stuff in the bed (or doing a camper-living space type of build), follow my steps here:
In-depth View of Electrical System for Overlanding and Offroading
start from section called "camper system"