Expand Derivation data type

This commit is contained in:
Doug Beardsley 2018-08-05 12:16:29 -04:00
parent 7a9fcdb22f
commit bc946a40b1

View File

@ -3,26 +3,29 @@ 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
-- TODO: Eventually Text should be Output, but we don't have it yet
{ _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)