leo
bfafc4a8be
All checks were successful
continuous-integration/drone/push Build is passing
* couple session-related attrs in a record * couple logger-pertaining attrs in a record * update config Go representation * update Go config consumers
24 lines
844 B
Haskell
24 lines
844 B
Haskell
{- import config schema that is integrity-check protected (with a fallback) -}
|
|
let ConfigSchema =
|
|
https://git.dotya.ml/mirre-mt/pcmt/raw/branch/development/config/schema/package.dhall
|
|
sha256:c82b0904c261d442e5765c2f47d76ad53c3c3ed16ace1b33416cedf98f2f5df0
|
|
? https://git.dotya.ml/mirre-mt/pcmt/raw/branch/development/config/schema/package.dhall
|
|
|
|
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
|