services: syncthing: incorrect guessing of HOME variable

Fixed the issue described here:
https://lists.gnu.org/archive/html/help-guix/2024-01/msg00034.html

Fix `syncthing-shepherd-service` failing to guess the correct `HOME`
environment variable when it's `<syncthing-configuration>` does not have a
value for the `home` or `user` fields.

* gnu/services/syncthing.scm (syncthing-shepherd-service): Change ‘HOME’
value in #:environment-variables argument.

Change-Id: I102bfe5feba1ebb349a0cde1c987c0c10ebbab7a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Sergio Pastor Pérez 2024-07-28 19:09:41 +02:00 committed by Ludovic Courtès
parent 0b65a43cf8
commit a1d367d6ee
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -73,7 +73,15 @@ (define syncthing-shepherd-service
#:user #$(and (not home-service?) user) #:user #$(and (not home-service?) user)
#:group #$(and (not home-service?) group) #:group #$(and (not home-service?) 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 (if (and #$home-service?
(not #$user))
(getuid)
#$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")
(filter (negate ;XXX: 'remove' is not in (guile) (filter (negate ;XXX: 'remove' is not in (guile)