2018-12-20 00:33:32 +02:00
|
|
|
{-# Language NoImplicitPrelude #-}
|
|
|
|
{-# Language DeriveGeneric #-}
|
|
|
|
{-# Language DuplicateRecordFields #-}
|
|
|
|
module Configuration where
|
|
|
|
|
|
|
|
import ClassyPrelude
|
|
|
|
import Dhall (Interpret)
|
|
|
|
|
|
|
|
data Pg = Pg { username :: Text
|
|
|
|
, password :: Text
|
|
|
|
, host :: Text
|
2019-01-21 22:35:05 +02:00
|
|
|
, database :: Text
|
|
|
|
, migrations :: Text }
|
2018-12-20 00:33:32 +02:00
|
|
|
deriving (Show, Generic)
|
|
|
|
|
|
|
|
data Store = Filestore { path :: Text }
|
|
|
|
| IPFS { common :: Text }
|
|
|
|
deriving (Show, Generic)
|
|
|
|
|
|
|
|
data Config = Config { database :: Pg
|
2019-01-22 00:08:51 +02:00
|
|
|
, store :: Store
|
|
|
|
, port :: Integer }
|
2018-12-20 00:33:32 +02:00
|
|
|
deriving (Show, Generic)
|
|
|
|
|
|
|
|
instance Interpret Pg
|
|
|
|
instance Interpret Store
|
|
|
|
instance Interpret Config
|
|
|
|
|