git.iko.soy/typeable/cabal2nix
on master help sign in
Options: allow changing nixpkgs identifier function
commit7c0ef5b6e43f75ef2d4e94e9c1e2c5842b625053 authorDomen Kožar <domen@dev.si> dateTue 10 Jul 2018, 18:17 (8 years ago) parent5fb2489
1 file changed+3−2
src/Cabal2nix.hs+3−2
src/Cabal2nix.hs+3−2
@@ -62,9 +62,9 @@ data Options = Options
6262 , optSystem :: Platform
6363 , optSubpath :: Maybe FilePath
6464 , optHackageSnapshot :: Maybe UTCTime
65+ , optNixpkgsIdentifier :: NixpkgsResolver
6566 , optUrl :: String
6667 }
67− deriving (Show)
6868
6969options :: Parser Options
7070options = Options
@@ -88,6 +88,7 @@ options = Options
8888 <*> option (maybeReader parsePlatform) (long "system" <> help "host system (in either short Nix format or full LLVM style) to use when evaluating the Cabal file" <> value buildPlatform <> showDefaultWith display)
8989 <*> optional (strOption $ long "subpath" <> metavar "PATH" <> help "Path to Cabal file's directory relative to the URI (default is root directory)")
9090 <*> optional (option utcTimeReader (long "hackage-snapshot" <> help "hackage snapshot time, ISO format"))
91+ <*> pure (\i -> Just (binding # (i, path # [i])))
9192 <*> strArgument (metavar "URI")
9293
9394-- | A parser for the date. Hackage updates happen maybe once or twice a month.
@@ -207,7 +208,7 @@ processPackage Options{..} pkg = do
207208
208209 deriv :: Derivation
209210 deriv = withHpackOverrides $ fromGenericPackageDescription (const True)
210− (\i -> Just (binding # (i, path # [i])))
211+ optNixpkgsIdentifier
211212 optSystem
212213 (unknownCompilerInfo optCompiler NoAbiTag)
213214 flags