The closest option is probably the GPD MicroPC. It's 6", but pretty damn close to the ideal of a truly tiny PC. I think they're making a successor to this finally, dunno what the status is.
I use termux daily, and you can stand up pretty much anything including a production grade PostgresDB. It's not a toy.