This may be more than you want to know, but it beats going outside and cutting weeds.
Lets look at some numbers, and start with Marc's number of 150 watts for the machine. First, remember that batteries are rated in amp-hrs. And amps= watts/volts. And solar panels only work in daylight.
So how does one get the power? That's a large light bulb, which is no problem from a generator or you're plugged into shore power. So, how do you get the power if you're at anchor and sleeping and don't want a generator running. At night, the only way I know is to use batteries and an inverter, as discussed by Mark. A 150 watt inverter is common and cheap, so all we need is to size the battery.
One needs a battery that can deliver at least 100 amp hrs, just for the sleep machine, as follows: 150 watts = 13 amps at 12 Volts. If one sleeps for 8 hours, that's 13 amps times 8 hours, ~100 amp-hrs. Lets add another 20 amp hrs for the lights, etc. so we're looking for 120 amp hrs.
A lead-acid battery doesn't like to be discharged below 50% of rated capacity, so we need to find a battery with about 240 amp-hr rated capacity. First, a group 31 deep cycle battery has about 105 a-h (West Marine) or 130 a-h (Trojan), so that doesn't fly. A 4D deep cycle has 185 a-h (WM) or 165 a-h (Trojan) which isn't enough and they are built for trucks (heavy.) Finally we go to a 6 Vdc golf cart battery which has 225 a-h capacity (Trojan,) and that just meets the requirement. Since they're 6 v you need 2 ea in series to get to 12 Vdc for the inverter. As a note, running batteries in parallel MAY cause trouble as the batteries age, so I don't like to suggest connecting 2 ea Group 31's in parallel.
Turns out that 2 ea Trojan T-105 will fit in the starboard lazarette, see the Journey On album for proof. Or, one can tie them down in the cockpit. And change all your cabin lights to LED lights so you can read at night whilst saving power.
Now, how do you charge these batteries? To recharge the batteries, you'll need 150 watts X 1.25 (recharge factor) X 8 hrs. equals about 1.5 kw-hr, not a large amount. I have solar panels for the house and I have used them on a boat when we're cruising. They get awfully big awfully fast. And remember they need to be pointed directly at the sun (normal to the sunline) to get rated power. Laying them flat on the cabin top and swinging at anchor isn't the most efficient. And the sun travels from horizon to horizon during the day. I'd estimate that you'll get 20% of their rated output during a non-cloudy day. Looking solar panels up on the internet, a 215 watt panel requires 17 sq. ft. (5 1/2 X 3 1/2 ft). And you'll need at least 2 ea. So, 2 ea 215 watt solar panels are about $1000.
Get a Honda 1000 generator for recharging at anchor, is my conclusion. $500 well spent. And make sure you get an outboard with a large alternator for when you're running.
So, it's doable, but takes some thinking.
Boris