Kumail Nanjiani is set to star in Valparaiso Pictures’ “No Glory,” a spy comedy that will be produced by Adam McKay and Will Ferrell.

“No Glory” is based on a manuscript written by a National Security Operative and author Scott Shephard about the operative’s time in service to the country. The unique account is 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.”

“I can’t wait to dig into this government operative and incredible story,” McKay said. “With Kumail at the helm this has a chance to be really ‘special,’ as Kumail likes to say.”

Sam Bain (“Corporate Animals”) is adapting the script. No director has been set.

Along with McKay and Ferrell’s Gary Sanchez Productions, the film’s producers are Valparaiso Picture’s David Carrico and Adam Paulsen, and Gary Sanchez Productions’ Chris Henchy. Valparaiso’s head of development Bobby Hoppey will executive produce. McKay and Nanjiani are overseeing Bain’s script. 30West is co-repping the film with UTA.

Nanjiani and his wife, Emily V. Gordon, received an Oscar nomination for writing “The Big Sick.” He will next be seen in Columbia Pictures’ “Men in Black: International” and Universal Pictures’ “The Voyage of Doctor Dolittle.” Production of a sixth season of HBO’s “Silicon Valley,” in which he stars as Dinesh Chugtai, is expected to take place this summer.

McKay wrote, directed, and produced “Vice,” a scathing Dick Cheney biopic that landed three Academy Award nominations. He co-wrote and directed Paramount’s “The Big Short,” which earned an Oscar, BAFTA, and WGA Award for best adapted screenplay.

Valparaiso Pictures premiered “The Sound of Silence,” starring Peter Sarsgaard and Rashida Jones in competition at Sundance.

Nanjiani is represented by UTA and Mosaic. Bain by UTA.  Valparaiso Pictures is repped by Craig Emanuel of Paul Hastings.