Merge pull request #17 from haskell-nix/derivation-restructuring

Expand Derivation data type
This commit is contained in:
Doug Beardsley 2018-08-05 14:52:38 -04:00 committed by GitHub
commit ec29e02e2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,26 +3,28 @@ Description : Derivation types
Maintainer : srk <srk@48.io>
|-}
module System.Nix.Derivation (
BasicDerivation(..)
) where
module System.Nix.Derivation where
import Data.Text (Text)
import Data.HashMap.Strict (HashMap)
import Data.HashSet (HashSet)
import System.Nix.Path
data BasicDerivation = BasicDerivation
{ -- | Derivation outputs
outputs :: !(HashMap Text Path)
, -- | Inputs that are sources
inputSrcs :: !PathSet
, -- | Platform
platform :: !Text
, -- | Path to builder
builder :: !Path
, -- | Arguments
args :: ![Text]
, -- | Environment
env :: ![HashMap Text Text]
type OutputName = Text
newtype DerivationInputs = DerivationInputs
{ _unDerivationInputs :: HashMap Path (HashSet OutputName)
} deriving (Eq, Ord, Show)
data Derivation = Derivation
{ _derivationInputs :: DerivationInputs
, _derivationOutputs :: !(HashMap OutputName Path)
-- | Inputs that are sources
, _derivationInputSrcs :: !PathSet
, _derivationPlatform :: !Text
-- | Path to builder
, _derivationBuilder :: !Path
, _derivationArgs :: ![Text]
, _derivationEnv :: ![HashMap Text Text]
} deriving (Eq, Ord, Show)