A bad habit I took up is both doing the occasional bit of work[1] and napping on the sofa, which is comfier on the posterior than sitting at the table (especially for napping!), and also a more natural position of working on the laptop/tablet on the couch if I'm reclined with knees up.
I've sort of manged to get my body inadvertently used to "sit here => consider going to sleep", which is a bother when all I'm doing is "pondering hard" about something (not quite the "I'm just resting my eyes", level, but) . Every now and then I found I've actually been asleep for half an hour, and the dreams I have, during them, can be both helpful and unhelpful to what I'm doing!. Interestingly, can include glasses/computing device(s)/headphones[2] somehow having been placed neatly on the appropriate nearby flat surface (or just safely undisturbed), apparently with entirely unconscious yet precision dexterity.
...but what I'm getting at is that perhaps you can develop a 'nap space', distinct from your bed as 'sleep space', but definitely try not to make it overlap with somewhere you would not want to nap, whether or not you think it possible to. But you would have to know what works for you. (Physically, physiologically and according to what your living space is like.)
[1] Whether 'work'-like work, or else just personal to-do projects.
[2] A bad habit of mine, even in bed. I can dream that I can't turn some (dream) sound-source off, and that's because it's what is still playing to me IRL, after having queued up more things to listen to than what I would eventually stay awake for.