mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2025-01-05 19:00:24 +03:00
Expand Derivation data type
This commit is contained in:
parent
7a9fcdb22f
commit
bc946a40b1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user