– Pete Holmes may be too happy for his own good. I admired his 2013 TBS talk show, which treated optimism as a virtue and avoided political satire like it was trigonometry. Jimmy Fallon gets away with an upbeat attitude, but he has an arsenal of impressions, A-list guests and late night’s best backup band. Holmes had a goofy grin and the budget of a community-college dorm party. It lasted less than a year.

Let’s hope his latest effort, “Crashing,” doesn’t have an early expiration date. It makes me too darn happy.

Debuting Sunday on HBO, it features Holmes as an unemployed man-child who has no problem letting his wife (Lauren Lapkus) provide financial support while he trolls open-mic nights at comedy clubs, forking over money for the two-drink minimum, waiting hours for a 1 a.m. slot, dealing with hecklers or, worse, dead silence.

And then: reality. His wife shacks up with a hippie-dippie schoolteacher, leaving him more or less homeless. Suddenly, telling jokes isn’t just a hobby; it’s the only thing he’s got left.

The premise is loosely based on Holmes’ own early days and how a divorce at age 28 forced him to take a serious look at telling jokes.

“There was a time I had one foot in the shallow end and it took a crisis to really rattle my cage and push me into the pool,” he said last month in an interview.

Exploring the world of stand-up comedy is hardly new territory for TV, but Holmes once again dares to be different. “Crashing,” which includes Judd Apatow as an executive producer, focuses on the five- to 10-year “dry” period that most wannabe comedians endure. The first four episodes capture that ordeal better than anything I’ve ever seen. Young pups drool over sliced pizza and endure the humiliation of handing out fliers on a West Village sidewalk in exchange for the chance to perform four minutes for drunks tricked into thinking Hannibal Buress might drop by.

Actually, Buress does appear, as do T.J. Miller, Artie Lange and Sarah Silverman, all playing versions of their real selves, poking fun at Holmes’ wide-eyed innocence, yet acknowledging that he’s part of their family. That conveys a certain level of respect — and “crashing” rights to their sofas.

“Comedy’s like the new religion, except we’re better than priests because we’re not lying,” says Miller in an early episode, tearing into Holmes’ wife for not appreciating his vocation.

It’s hard to imagine a bigger underdog than Holmes’ character. Yes, he’s got decent material, but he also has a bad complexion, love handles and a wardrobe from the Charlie Brown Collection at T.J. Maxx. He also is a determined Christian, a rare shout-out for evangelical values on HBO.

On one level, Holmes said, the series essentially asks, “How much of your ethics are going to continue in your next phase of life, and what experiences are going to show you what you’re really made of?”

Beyond that, “Judd and I really jumped at the opportunity to make a show about what it’s like before you’re making any money and what it takes to grind it out in a city like New York that doesn’t want you or need you.”

The Big Apple may not need another struggling comedian. But TV could sure use a guy like Holmes.