services: admin: Add a generate-documentation procedure
parent
dc562d7a2d
commit
4dbfc6d3f6
|
@ -81,18 +81,17 @@ match those specified. The keyword args alone means that command must be run
|
||||||
without arguments.")
|
without arguments.")
|
||||||
(setenv
|
(setenv
|
||||||
maybe-assoc-list
|
maybe-assoc-list
|
||||||
"Keep or set the specified variables. Variables may also be removed by
|
"Set the specified variables. Variables may also be removed by setting them
|
||||||
setting them to #f. If the first character of the value is ‘$’ then the value
|
to #f, or simply exported, by setting them to #t. If the first character of the
|
||||||
to be set is taken from the existing environment variable with the given name.
|
value is ‘$’ then the value to be set is taken from the existing environment
|
||||||
This options is processed after the default environment variable has been
|
variable with the given name."))
|
||||||
created."))
|
|
||||||
(define-syntax-rule (permit entry ...)
|
(define-syntax-rule (permit entry ...)
|
||||||
(permit-statement entry ...))
|
(permit-statement entry ...))
|
||||||
|
|
||||||
(define (unset? val)
|
(define (unset? val)
|
||||||
"Tests if VAL is unset."
|
"Tests if VAL is unset."
|
||||||
(equal? val (@@ (gnu services configuration)
|
(equal? val (@@ (gnu services configuration)
|
||||||
%unset-value)))
|
%unset-value)))
|
||||||
|
|
||||||
(define* (if-set val #:optional (proc identity))
|
(define* (if-set val #:optional (proc identity))
|
||||||
"Apply PROC to VAL if VAL is not unset, otherwise returns #f."
|
"Apply PROC to VAL if VAL is not unset, otherwise returns #f."
|
||||||
|
@ -152,10 +151,11 @@ without arguments."))
|
||||||
(define (doas-config-file config)
|
(define (doas-config-file config)
|
||||||
(plain-file "doas.conf"
|
(plain-file "doas.conf"
|
||||||
(apply string-append
|
(apply string-append
|
||||||
(map (lambda (s) (cond ((permit-statement? s)
|
(map (lambda (s)
|
||||||
(serialize-permit-statement s))
|
(cond ((permit-statement? s)
|
||||||
((deny-statement? s)
|
(serialize-permit-statement s))
|
||||||
(serialize-deny-statement s))))
|
((deny-statement? s)
|
||||||
|
(serialize-deny-statement s))))
|
||||||
config))))
|
config))))
|
||||||
|
|
||||||
(define (doas-etc-service config)
|
(define (doas-etc-service config)
|
||||||
|
@ -171,3 +171,7 @@ without arguments."))
|
||||||
(extend append)
|
(extend append)
|
||||||
(default-value '())
|
(default-value '())
|
||||||
(description "Set /etc/doas.conf")))
|
(description "Set /etc/doas.conf")))
|
||||||
|
|
||||||
|
(define (generate-documentation)
|
||||||
|
(configuration->documentation 'permit-statement)
|
||||||
|
(configuration->documentation 'deny-statement))
|
||||||
|
|
Loading…
Reference in New Issue