Installing new fixture over medicine cabinet
As noted by commenters, you should never disconnect something without noting how it was connected in the first place. With smartphones common and handy, at least take a picture next time.

Educated guess here, but the non-hot wire was probably the switch. It's easy enough to check.


Take the wall plate off the switch and unscrew it from the box. Verify the wires are not hot. If it has a white and black connected to the switch, proceed to step 2. If you have any other colors (i.e. 2 blacks. connected STOP and get an electrician.
Assuming a white and black, turn the breaker off and connect the white wire you nutted off to your hot black wire. Now, turn the breaker on. If you have power at the switch, you have your answer. If not, STOP an consult an electrician.
Assuming Step 2 was successful, remove the nut from the black wire at your fixture and wire it to the hot side. Put everything back and you now have your switch working.