services: syncthing: Use 'match-record'.
* gnu/services/syncthing.scm (syncthing-shepherd-service): Use 'match-record-lambda' instead of 'match-lambda'.
This commit is contained in:
parent
9bfe7fbdbe
commit
c6c8106c65
1 changed files with 26 additions and 26 deletions
|
@ -52,32 +52,32 @@
|
||||||
(default #f)))
|
(default #f)))
|
||||||
|
|
||||||
(define syncthing-shepherd-service
|
(define syncthing-shepherd-service
|
||||||
(match-lambda
|
(match-record-lambda <syncthing-configuration>
|
||||||
(($ <syncthing-configuration> syncthing arguments logflags user group home)
|
(syncthing arguments logflags user group home)
|
||||||
(list
|
(list
|
||||||
(shepherd-service
|
(shepherd-service
|
||||||
(provision (list (string->symbol (string-append "syncthing-" user))))
|
(provision (list (string->symbol (string-append "syncthing-" user))))
|
||||||
(documentation "Run syncthing.")
|
(documentation "Run syncthing.")
|
||||||
(requirement '(loopback))
|
(requirement '(loopback))
|
||||||
(start #~(make-forkexec-constructor
|
(start #~(make-forkexec-constructor
|
||||||
(append (list (string-append #$syncthing "/bin/syncthing")
|
(append (list (string-append #$syncthing "/bin/syncthing")
|
||||||
"--no-browser"
|
"--no-browser"
|
||||||
"--no-restart"
|
"--no-restart"
|
||||||
(string-append "--logflags=" (number->string #$logflags)))
|
(string-append "--logflags=" (number->string #$logflags)))
|
||||||
'#$arguments)
|
'#$arguments)
|
||||||
#:user #$user
|
#:user #$user
|
||||||
#:group #$group
|
#:group #$group
|
||||||
#:environment-variables
|
#:environment-variables
|
||||||
(append (list (string-append "HOME=" (or #$home (passwd:dir (getpw #$user))))
|
(append (list (string-append "HOME=" (or #$home (passwd:dir (getpw #$user))))
|
||||||
"SSL_CERT_DIR=/etc/ssl/certs"
|
"SSL_CERT_DIR=/etc/ssl/certs"
|
||||||
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
|
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
|
||||||
(remove (lambda (str)
|
(remove (lambda (str)
|
||||||
(or (string-prefix? "HOME=" str)
|
(or (string-prefix? "HOME=" str)
|
||||||
(string-prefix? "SSL_CERT_DIR=" str)
|
(string-prefix? "SSL_CERT_DIR=" str)
|
||||||
(string-prefix? "SSL_CERT_FILE=" str)))
|
(string-prefix? "SSL_CERT_FILE=" str)))
|
||||||
(environ)))))
|
(environ)))))
|
||||||
(respawn? #f)
|
(respawn? #f)
|
||||||
(stop #~(make-kill-destructor)))))))
|
(stop #~(make-kill-destructor))))))
|
||||||
|
|
||||||
(define syncthing-service-type
|
(define syncthing-service-type
|
||||||
(service-type (name 'syncthing)
|
(service-type (name 'syncthing)
|
||||||
|
|
Reference in a new issue