leo
f8df3f3806
All checks were successful
continuous-integration/drone/push Build is passing
the Dhall config package formerly in ./config/schema has been moved to https://git.dotya.ml/mirre-mt/pcmt-config-schema/, meaning the schema has been decoupled from this repository. the schema is now being versioned, which makes it easier to progress without breaking stuff (unless we wanted to reference the versions by commit hashes...). * use schema version 0.0.0
24 lines
826 B
Haskell
24 lines
826 B
Haskell
{- import config schema that is integrity-check protected (with a fallback) -}
|
|
let ConfigSchema =
|
|
https://git.dotya.ml/mirre-mt/pcmt-config-schema/raw/tag/0.0.0/package.dhall
|
|
sha256:c82b0904c261d442e5765c2f47d76ad53c3c3ed16ace1b33416cedf98f2f5df0
|
|
? https://git.dotya.ml/mirre-mt/pcmt-config-schema/raw/tag/0.0.0/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
|