services: admin: Add a generate-documentation procedure

pull/1/head
Luis Guilherme Coelho 2023-12-24 06:02:35 -03:00
parent dc562d7a2d
commit 4dbfc6d3f6
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
1 changed files with 14 additions and 10 deletions

View File

@ -81,11 +81,10 @@ 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 ...))
@ -152,7 +151,8 @@ 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)
(cond ((permit-statement? s)
(serialize-permit-statement s)) (serialize-permit-statement s))
((deny-statement? s) ((deny-statement? s)
(serialize-deny-statement s)))) (serialize-deny-statement s))))
@ -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))