services: mcron: Fix home version not respecting user PATH variable.

Without this fix, deploying `home-mcron-service-type' will strip user's PATH
variable from it's environment. This means that, programs such as `notmuch',
which use hooks which usually invoke `notmuch' from path, would need to be
updated with full paths; which makes it very inconvenient to use.

* gnu/services/mcron.scm (mcron-shepherd-services): respect user PATH variable.

Change-Id: I104aa0a818ad6c3266b2b8f73a9609bfb36e314d
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Sergio Pastor Pérez 2024-08-11 00:40:26 +02:00 committed by Ludovic Courtès
parent 1fb4c399ea
commit ebe00a20e2
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -182,9 +182,12 @@ (define (mcron-shepherd-services config)
;; set a sane value for 'PATH'.
#:environment-variables
(cons* "GUILE_AUTO_COMPILE=0"
#$(if home-service?
'(environ)
'(cons*
"PATH=/run/current-system/profile/bin"
(remove (cut string-prefix? "PATH=" <>)
(environ)))
(environ)))))
#:log-file #$log-file))
(stop #~(make-kill-destructor))