services: configuration: Re-order generated record fields.

This is so that the first field of the generated record matches the first one
declared, which makes 'define-configuration' record API compatible with
define-record-type* ones.

* gnu/services/configuration.scm (define-configuration-helper): Move the
%location field below the ones declared by the user.
* gnu/services/monitoring.scm (zabbix-front-end-config): Adjust match pattern
accordingly.
This commit is contained in:
Maxim Cournoyer 2022-10-28 17:06:16 -04:00
parent 8f9588185d
commit 543d971ed2
No known key found for this signature in database
GPG key ID: 1260E46482E63562
2 changed files with 7 additions and 7 deletions

View file

@ -242,17 +242,17 @@ (define-record-type* #,(id #'stem #'< #'stem #'>)
stem stem
#,(id #'stem #'make- #'stem) #,(id #'stem #'make- #'stem)
#,(id #'stem #'stem #'?) #,(id #'stem #'stem #'?)
(%location #,(id #'stem #'stem #'-location)
(default (and=> (current-source-location)
source-properties->location))
(innate))
#,@(map (lambda (name getter def) #,@(map (lambda (name getter def)
#`(#,name #,getter (default #,def) #`(#,name #,getter (default #,def)
(sanitize (sanitize
#,(id #'stem #'validate- #'stem #'- name)))) #,(id #'stem #'validate- #'stem #'- name))))
#'(field ...) #'(field ...)
#'(field-getter ...) #'(field-getter ...)
#'(field-default ...))) #'(field-default ...))
(%location #,(id #'stem #'stem #'-location)
(default (and=> (current-source-location)
source-properties->location))
(innate)))
(define #,(id #'stem #'stem #'-fields) (define #,(id #'stem #'stem #'-fields)
(list (configuration-field (list (configuration-field

View file

@ -622,8 +622,8 @@ (define-configuration zabbix-front-end-configuration
(define (zabbix-front-end-config config) (define (zabbix-front-end-config config)
(match-record config <zabbix-front-end-configuration> (match-record config <zabbix-front-end-configuration>
(%location db-host db-port db-name db-user db-password db-secret-file (db-host db-port db-name db-user db-password db-secret-file
zabbix-host zabbix-port) zabbix-host zabbix-port %location)
(mixed-text-file "zabbix.conf.php" (mixed-text-file "zabbix.conf.php"
"\ "\
<?php <?php