synit/experiments/layered-server-config/boot/020-load-system-layer.pr

29 lines
904 B
Promela

; Attenuate `$config` by rewriting plain `require-service` assertions to
; `require-system-service` assertions. Allow all other assertions through.
;
let ?sys = <* $config [
<rewrite <require-service ?s> <require-system-service $s>>
<filter _>
]>
; Give meaning to `require-system-service`: it is an ordinary `require-service`, plus a
; declaration that the `system-layer` milestone depends on the service.
;
? <require-system-service ?s> [
<depends-on <milestone system-layer> <service-state $s up>>
<require-service $s>
]
; Load config in the `system-layer` directory, using the wrapped `config` so that all plain
; services required are changed to be *system* services.
;
<require-service <config-watcher "./system-layer" {
config: $sys
gatekeeper: $gatekeeper
log: $log
}>>
; In addition, require the `system-layer` milestone explicitly.
;
<require-service <milestone system-layer>>