@@ -36,6 +36,7 @@ data Options = Options
36 , optEnableLibraryProfiling :: Bool
36 , optEnableLibraryProfiling :: Bool
37 , optEnableExecutableProfiling :: Bool
37 , optEnableExecutableProfiling :: Bool
38 , optEnableProfiling :: Maybe Bool
38 , optEnableProfiling :: Maybe Bool
39+ , optExtraArgs :: [String]
39 , optHackageDb :: Maybe FilePath
40 , optHackageDb :: Maybe FilePath
40 , optNixShellOutput :: Bool
41 , optNixShellOutput :: Bool
41 , optFlags :: [String]
42 , optFlags :: [String]
@@ -56,6 +57,7 @@ options = Options
56 <*> switch (long "enable-library-profiling" <> help "enable library profiling in the generated build")
57 <*> switch (long "enable-library-profiling" <> help "enable library profiling in the generated build")
57 <*> switch (long "enable-executable-profiling" <> help "enable executable profiling in the generated build")
58 <*> switch (long "enable-executable-profiling" <> help "enable executable profiling in the generated build")
58 <*> optional (switch (long "enable-profiling" <> help "enable both library and executable profiling in the generated build"))
59 <*> optional (switch (long "enable-profiling" <> help "enable both library and executable profiling in the generated build"))
60+ <*> many (strOption $ long "extra-arguments" <> help "extra parameters required for the function body")
59 <*> optional (strOption $ long "hackage-db" <> metavar "PATH" <> help "path to the local hackage db in tar format")
61 <*> optional (strOption $ long "hackage-db" <> metavar "PATH" <> help "path to the local hackage db in tar format")
60 <*> switch (long "shell" <> help "generate output suitable for nix-shell")
62 <*> switch (long "shell" <> help "generate output suitable for nix-shell")
61 <*> many (strOption $ short 'f' <> long "flag" <> help "Cabal flag (may be specified multiple times)")
63 <*> many (strOption $ short 'f' <> long "flag" <> help "Cabal flag (may be specified multiple times)")
@@ -111,7 +113,7 @@ main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do
111 & metaSection.maintainers .~ Set.fromList (map (review ident) optMaintainer)
113 & metaSection.maintainers .~ Set.fromList (map (review ident) optMaintainer)
112-- & metaSection.platforms .~ Set.fromList optPlatform
114-- & metaSection.platforms .~ Set.fromList optPlatform
113 & doCheck &&~ optDoCheck
115 & doCheck &&~ optDoCheck
114− & extraFunctionArgs . contains "stdenv" .~ True
116+ & extraFunctionArgs %~ (Set.union (Set.fromList ("stdenv":(map (review ident) optExtraArgs))))
116 shell :: Doc
118 shell :: Doc
117 shell = vcat
119 shell = vcat