Very bad idea. If you're buying it for home protection, turn off all the lights. Set an alarm on your phone for 3:27 AM. Fall asleep on your couch.
When the alarm wakes you up, pretend you have exactly 15 seconds to get to, unlock, and ready your rifle.
If you have reasons, kids, shitty roomates, etc...maybe leave the rifle out and hide the mags away, but close by.
The gun safe is for guns you don't want stolen, and guns you bring to the range you don't need to leave out.
The underside of the bed you sleep on, or the nightstand next to you is where the gun you plan on defending your life with goes.
Wife and I both have our carry pistols on the nightstands on our sides, and our rifles slung on the headboard on either sides. Everything else is in the safe.
Also, consider training with a pistol and picking one up. 99% of the time, the pistol will be on you or near you, and you don't have to rely on getting home to have a firearm when you need it.