-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Convert Cabal files into Nix build instructions. -- -- Convert Cabal files into Nix build instructions. Users of Nix can -- install the latest version by running: -- --
--   nix-env -i cabal2nix
--   
@package cabal2nix @version 2.13 module Distribution.Nixpkgs.Fetch -- | A source is a location from which we can fetch, such as a HTTP URL, a -- GIT URL, .... data Source Source :: String -> String -> Hash -> String -> Source -- | URL to fetch from. [sourceUrl] :: Source -> String -- | Revision to use. For protocols where this doesn't make sense (such as -- HTTP), this should be the empty string. [sourceRevision] :: Source -> String -- | The expected hash of the source, if available. [sourceHash] :: Source -> Hash -- | Directory where Cabal file is found. [sourceCabalDir] :: Source -> String data Hash Certain :: String -> Hash Guess :: String -> Hash UnknownHash :: Hash -- | A source for a derivation. It always needs a hash and also has a -- protocol attached to it (url, git, svn, ...). A -- DerivationSource also always has it's revision fully resolved -- (not relative revisions like master, HEAD, etc). data DerivationSource DerivationSource :: String -> String -> String -> String -> Maybe Bool -> DerivationSource -- | The kind of the source. The name of the build-support fetch derivation -- should be fetchkind. [derivKind] :: DerivationSource -> String -- | URL to fetch from. [derivUrl] :: DerivationSource -> String -- | Revision to use. Leave empty if the fetcher doesn't support revisions. [derivRevision] :: DerivationSource -> String -- | The hash of the source. [derivHash] :: DerivationSource -> String -- | The fetchSubmodule setting (if any) [derivSubmodule] :: DerivationSource -> Maybe Bool fromDerivationSource :: DerivationSource -> Source urlDerivationSource :: String -> String -> DerivationSource -- | Fetch a source, trying any of the various nix-prefetch-* scripts. fetch :: forall a. Bool -> (String -> MaybeT IO a) -> Source -> IO (Maybe (DerivationSource, a)) -- | Like fetch, but allows to specify which script to use. fetchWith :: (Bool, String, [String]) -> Source -> MaybeT IO (DerivationSource, FilePath) instance GHC.Generics.Generic Distribution.Nixpkgs.Fetch.DerivationSource instance GHC.Classes.Ord Distribution.Nixpkgs.Fetch.DerivationSource instance GHC.Classes.Eq Distribution.Nixpkgs.Fetch.DerivationSource instance GHC.Show.Show Distribution.Nixpkgs.Fetch.DerivationSource instance GHC.Generics.Generic Distribution.Nixpkgs.Fetch.Source instance GHC.Classes.Ord Distribution.Nixpkgs.Fetch.Source instance GHC.Classes.Eq Distribution.Nixpkgs.Fetch.Source instance GHC.Show.Show Distribution.Nixpkgs.Fetch.Source instance GHC.Generics.Generic Distribution.Nixpkgs.Fetch.Hash instance GHC.Classes.Ord Distribution.Nixpkgs.Fetch.Hash instance GHC.Classes.Eq Distribution.Nixpkgs.Fetch.Hash instance GHC.Show.Show Distribution.Nixpkgs.Fetch.Hash instance Control.DeepSeq.NFData Distribution.Nixpkgs.Fetch.DerivationSource instance Data.Aeson.Types.FromJSON.FromJSON Distribution.Nixpkgs.Fetch.DerivationSource instance Text.PrettyPrint.HughesPJClass.Pretty Distribution.Nixpkgs.Fetch.DerivationSource instance Control.DeepSeq.NFData Distribution.Nixpkgs.Fetch.Source instance Control.DeepSeq.NFData Distribution.Nixpkgs.Fetch.Hash module Distribution.Nixpkgs.Haskell.BuildInfo data BuildInfo haskell :: Lens' BuildInfo (Set Binding) pkgconfig :: Lens' BuildInfo (Set Binding) system :: Lens' BuildInfo (Set Binding) tool :: Lens' BuildInfo (Set Binding) pPrintBuildInfo :: String -> BuildInfo -> Doc instance Control.Lens.Each.Each Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo (Data.Set.Internal.Set Language.Nix.Binding.Binding) (Data.Set.Internal.Set Language.Nix.Binding.Binding) instance GHC.Base.Semigroup Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo instance GHC.Base.Monoid Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo instance Control.DeepSeq.NFData Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo instance GHC.Generics.Generic Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo instance GHC.Classes.Eq Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo instance GHC.Show.Show Distribution.Nixpkgs.Haskell.BuildInfo.BuildInfo module Distribution.Nixpkgs.Haskell.FromCabal.License fromCabalLicense :: License -> License fromSPDXLicense :: License -> License isFreeLicense :: License -> Bool module Distribution.Nixpkgs.Haskell.FromCabal.Name -- | Map Cabal names to Nix attribute names. toNixName :: PackageName -> Identifier -- | Map library names specified in Cabal files to Nix package identifiers. -- -- TODO: This list should not be hard-coded here; it belongs into the -- Nixpkgs repository. -- -- TODO: Re-use hook matching system from PostProcess.hs here. libNixName :: String -> [Identifier] -- | Map build tool names to Nix attribute names. buildToolNixName :: String -> [Identifier] module Distribution.Nixpkgs.Haskell.Hackage type HackageDB = Map PackageName PackageData type PackageData = Map Version VersionData data VersionData VersionData :: !GenericPackageDescription -> !String -> !Maybe String -> VersionData [cabalFile] :: VersionData -> !GenericPackageDescription [cabalFileSha256] :: VersionData -> !String [tarballSha256] :: VersionData -> !Maybe String -- | Determine the default path of the Hackage database, which typically -- resides at -- "$HOME/.cabal/packages/hackage.haskell.org/00-index.tar". -- Running the command "cabal update" will keep that file -- up-to-date. hackageTarball :: IO FilePath readTarball :: Maybe UTCTime -> FilePath -> IO HackageDB parsePackageData :: HackageDB -> PackageName -> PackageData -> PackageData instance GHC.Show.Show Distribution.Nixpkgs.Haskell.Hackage.VersionData module Distribution.Nixpkgs.Haskell.OrphanInstances instance Control.DeepSeq.NFData Distribution.Compiler.CompilerInfo instance Control.DeepSeq.NFData Distribution.Compiler.AbiTag instance Data.String.IsString Distribution.Types.Version.Version instance Data.String.IsString Distribution.Types.VersionRange.VersionRange instance Data.String.IsString Distribution.Types.PackageId.PackageIdentifier instance Data.String.IsString Distribution.Types.Dependency.Dependency instance Data.String.IsString Distribution.Compiler.CompilerId instance Data.String.IsString Distribution.System.Platform instance Data.Aeson.Types.FromJSON.FromJSON Distribution.System.Platform instance Data.Aeson.Types.FromJSON.FromJSON Distribution.Types.PackageName.PackageName instance Data.Aeson.Types.FromJSON.FromJSON Distribution.Types.PackageId.PackageIdentifier instance Data.Aeson.Types.FromJSON.FromJSON Distribution.Types.Dependency.Dependency instance Data.Aeson.Types.FromJSON.FromJSON Distribution.Compiler.CompilerInfo module Distribution.Nixpkgs.Haskell.FromCabal.Flags configureCabalFlags :: PackageIdentifier -> FlagAssignment module Distribution.Nixpkgs.Haskell.Derivation -- | A represtation of Nix expressions for building Haskell packages. The -- data type correspond closely to the definition of -- PackageDescription from Cabal. data Derivation nullDerivation :: Derivation pkgid :: Lens' Derivation PackageIdentifier revision :: Lens' Derivation Int src :: Lens' Derivation DerivationSource subpath :: Lens' Derivation FilePath isLibrary :: Lens' Derivation Bool isExecutable :: Lens' Derivation Bool extraFunctionArgs :: Lens' Derivation (Set Binding) libraryDepends :: Lens' Derivation BuildInfo executableDepends :: Lens' Derivation BuildInfo testDepends :: Lens' Derivation BuildInfo configureFlags :: Lens' Derivation (Set String) cabalFlags :: Lens' Derivation FlagAssignment runHaddock :: Lens' Derivation Bool jailbreak :: Lens' Derivation Bool doCheck :: Lens' Derivation Bool doBenchmark :: Lens' Derivation Bool testTarget :: Lens' Derivation String hyperlinkSource :: Lens' Derivation Bool enableSplitObjs :: Lens' Derivation Bool enableLibraryProfiling :: Lens' Derivation Bool enableExecutableProfiling :: Lens' Derivation Bool phaseOverrides :: Lens' Derivation String editedCabalFile :: Lens' Derivation String metaSection :: Lens' Derivation Meta dependencies :: Traversal' Derivation BuildInfo setupDepends :: Lens' Derivation BuildInfo benchmarkDepends :: Lens' Derivation BuildInfo enableSeparateDataOutput :: Lens' Derivation Bool instance Distribution.Package.Package Distribution.Nixpkgs.Haskell.Derivation.Derivation instance Control.DeepSeq.NFData Distribution.Nixpkgs.Haskell.Derivation.Derivation instance Text.PrettyPrint.HughesPJClass.Pretty Distribution.Nixpkgs.Haskell.Derivation.Derivation instance GHC.Generics.Generic Distribution.Nixpkgs.Haskell.Derivation.Derivation instance GHC.Classes.Eq Distribution.Nixpkgs.Haskell.Derivation.Derivation instance GHC.Show.Show Distribution.Nixpkgs.Haskell.Derivation.Derivation module Distribution.Nixpkgs.Haskell module Distribution.Nixpkgs.Haskell.FromCabal.PostProcess postProcess :: Derivation -> Derivation pkg :: Identifier -> Binding module Distribution.Nixpkgs.Haskell.FromCabal.Normalize normalize :: Derivation -> Derivation module Distribution.Nixpkgs.Haskell.Constraint type Constraint = Dependency satisfiesConstraint :: PackageIdentifier -> Constraint -> Bool satisfiesConstraints :: PackageIdentifier -> [Constraint] -> Bool module Distribution.Nixpkgs.Haskell.FromCabal.Configuration data Configuration Configuration :: CompilerInfo -> Set PackageIdentifier -> [Constraint] -> [Constraint] -> Map PackageName (Set Platform) -> Map Identifier (Set PackageName) -> Configuration -- | Target compiler. Used by finalizePackageDescription to choose -- appropriate flags and dependencies. [compilerInfo] :: Configuration -> CompilerInfo -- | Compiler core packages that are also found on Hackage. [corePackages] :: Configuration -> Set PackageIdentifier -- | These packages replace the latest respective version during dependency -- resolution. [defaultPackageOverrides] :: Configuration -> [Constraint] -- | These packages are added to the generated set, but the play no role -- during dependency resolution. [extraPackages] :: Configuration -> [Constraint] -- | We know that these packages won't build, so we give them an empty -- meta.hydraPlatforms attribute to avoid cluttering our Hydra output -- with lots of failure messages. [dontDistributePackages] :: Configuration -> Map PackageName (Set Platform) -- | This information is used by the hackage2nix utility to -- determine the maintainers for a given Haskell package. [packageMaintainers] :: Configuration -> Map Identifier (Set PackageName) readConfiguration :: FilePath -> IO Configuration assertConsistency :: Monad m => Configuration -> m Configuration instance GHC.Generics.Generic Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Configuration instance GHC.Show.Show Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Configuration instance Control.DeepSeq.NFData Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Configuration instance Data.Aeson.Types.FromJSON.FromJSON Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Configuration instance Data.Aeson.Types.FromJSON.FromJSON Language.Nix.Identifier.Identifier instance Data.Aeson.Types.FromJSON.FromJSONKey Language.Nix.Identifier.Identifier instance Data.Aeson.Types.FromJSON.FromJSONKey Distribution.Types.PackageName.PackageName module Distribution.Nixpkgs.Haskell.FromCabal type HaskellResolver = Dependency -> Bool type NixpkgsResolver = Identifier -> Maybe Binding fromGenericPackageDescription :: HaskellResolver -> NixpkgsResolver -> Platform -> CompilerInfo -> FlagAssignment -> [Constraint] -> GenericPackageDescription -> Derivation finalizeGenericPackageDescription :: HaskellResolver -> Platform -> CompilerInfo -> FlagAssignment -> [Constraint] -> GenericPackageDescription -> (PackageDescription, [Dependency]) fromPackageDescription :: HaskellResolver -> NixpkgsResolver -> [Dependency] -> FlagAssignment -> PackageDescription -> Derivation module Distribution.Nixpkgs.Haskell.PackageSourceSpec data Package Package :: DerivationSource -> Bool -> GenericPackageDescription -> Package [pkgSource] :: Package -> DerivationSource -- | If hpack generated a new cabal file [pkgRanHpack] :: Package -> Bool [pkgCabal] :: Package -> GenericPackageDescription getPackage :: Bool -> Bool -> Maybe FilePath -> Maybe UTCTime -> Source -> IO Package getPackage' :: Bool -> Bool -> IO HackageDB -> Source -> IO Package loadHackageDB :: Maybe FilePath -> Maybe UTCTime -> IO HackageDB sourceFromHackage :: Hash -> String -> FilePath -> IO DerivationSource instance GHC.Show.Show Distribution.Nixpkgs.Haskell.PackageSourceSpec.Package module Cabal2nix main :: IO () cabal2nix :: [String] -> IO () cabal2nix' :: Options -> IO (Either Doc Derivation) cabal2nixWithDB :: HackageDB -> Options -> IO (Either Doc Derivation) parseArgs :: [String] -> IO Options data Options Options :: Maybe String -> [String] -> Bool -> Bool -> Bool -> Bool -> Bool -> Maybe String -> Bool -> Bool -> Bool -> Maybe Bool -> [String] -> Maybe FilePath -> Bool -> [String] -> CompilerId -> Platform -> Maybe FilePath -> Maybe UTCTime -> NixpkgsResolver -> String -> Bool -> Options [optSha256] :: Options -> Maybe String [optMaintainer] :: Options -> [String] [optHaddock] :: Options -> Bool [optHpack] :: Options -> Bool [optDoCheck] :: Options -> Bool [optJailbreak] :: Options -> Bool [optDoBenchmark] :: Options -> Bool [optRevision] :: Options -> Maybe String [optHyperlinkSource] :: Options -> Bool [optEnableLibraryProfiling] :: Options -> Bool [optEnableExecutableProfiling] :: Options -> Bool [optEnableProfiling] :: Options -> Maybe Bool [optExtraArgs] :: Options -> [String] [optHackageDb] :: Options -> Maybe FilePath [optNixShellOutput] :: Options -> Bool [optFlags] :: Options -> [String] [optCompiler] :: Options -> CompilerId [optSystem] :: Options -> Platform [optSubpath] :: Options -> Maybe FilePath [optHackageSnapshot] :: Options -> Maybe UTCTime [optNixpkgsIdentifier] :: Options -> NixpkgsResolver [optUrl] :: Options -> String [optFetchSubmodules] :: Options -> Bool