23 lines
728 B
Haskell
23 lines
728 B
Haskell
{- import config schema that is integrity-check protected -}
|
|
let ConfigSchema =
|
|
https://git.dotya.ml/mirre-mt/pcmt/raw/branch/development/config/schema/package.dhall
|
|
sha256:ad7ba86d5d388a99b7543faa0e4c81ba1d9b78fa6c32fdaf4ac4477089d177be
|
|
|
|
let Config = ConfigSchema.Schema
|
|
|
|
let c =
|
|
{- below we allow overriding config values using env vars -}
|
|
Config::{
|
|
, Host = env:PCMT_HOST as Text ? Config.default.Host
|
|
, LiveMode = env:PCMT_LIVE ? True
|
|
, DevelMode = env:PCMT_DEVEL ? True
|
|
}
|
|
|
|
let _ =
|
|
{- validate that the above adheres to the config schema and contains valid
|
|
entries (not everything gets validated though).
|
|
-}
|
|
assert : ConfigSchema.Schema/validate c
|
|
|
|
in c
|