Doesn't matter if one does it on their own time and on their own equipment. It entirely* depends on any agreements one has with their employer. Moonlighting and intellectual property can get very sticky very quickly.
*modulo applicable laws in your part of the world
Previously: https://news.ycombinator.com/item?id=2208056