Silicon Valley star Kumail Nanjiani is attached to play the lead in the action-comedy No Glory, which counts Will Ferrell and Adam McKay among its producers, it was announced Wednesday by Valparaiso Pictures.

Sam Bain (Corporate Animals) wrote the script, which is based on an original manuscript co-written by a National Security Operative and author Scott Shephard about the operative’s time in service to the country. It’s a unique account described as “The Rambunctious Patriotism and World-Wide Shenanigans of a First Generation American in the Clandestine Service of a Grateful and Mostly Unwitting Nation.”

Valparaiso’s David Carrico and Adam Paulsen are producing alongside Gary Sanchez Productions principals Ferrell, McKay and Chris Henchy. Valparaiso’s head of development Bobby Hoppey will executive produce, and McKay and Nanjiani will jointly oversee the development of Bain’s script. 30WEST is co-repping the film with UTA.

“I can’t wait to dig into this incredible true story. With Kumail at the helm this has a chance to be really ‘special,’ as Kumail likes to say,” said McKay. “This is the type of story that we created our company to help tell, narratives that can have broad commercial appeal without sacrificing artistry,” added Carrico.

Nanjiani, who earned an Oscar nomination for co-writing The Big Sick, will soon be seen in Sony’s tentpole Men in Black: International and the Fox comedy Stuber. He also lends his voice to Universal’s Robert Downey Jr. movie The Voyage of Doctor Dolittle. No Glory sounds like an intriguing role for Nanjiani, especially considering he’ll have direct input on the script, so I look forward to seeing how this project comes together over the rest of the year.

McKay is hot off three individual Oscar nominations for his Dick Cheney movie Vice, and he previously won an Oscar for co-writing The Big Short, which also brought him his first nomination as a director.

Bain wrote Patrick Brice’s Sundance comedy Corporate Animals starring Demi Moore and Ed Helms as well as the upcoming indie comedy The Stand-In starring Drew Barrymore. Valparaiso also had a film recently premiere at Sundance, as it produced The Sound of Silence starring Peter Sarsgaard and Rashida Jones.

Nanjiani is represented by Mosaic and UTA, the latter of which also reps Bain.