pcmt/exampleConfig.dhall
leo d9265cafa8
config: use new form + add example [skip ci]
* also unstage config.dhall and add it to the list of the ignored
2023-05-04 21:40:25 +02:00

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