all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#72566] [PATCH] services: mcron: Fix home version not respecting user PATH variable.
@ 2024-08-10 22:40 Sergio Pastor Pérez
  2024-08-28 14:26 ` bug#72566: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Sergio Pastor Pérez @ 2024-08-10 22:40 UTC (permalink / raw)
  To: 72566; +Cc: Sergio Pastor Pérez

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
---
This patch makes `home-mcron-service-type' respect user's PATH environment
variable, allowing to write jobs which refer to programs in PATH, instead of
relying on writing the absolute path to those programs. Although jobs can be
GEXPs, which facilitates writing those absolute paths, the programs they invoke
can rely on the PATH environment variable to invoke other programs; for example,
`notmuch' hooks.

 gnu/services/mcron.scm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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

base-commit: de714bcb46d61922e0efc10783ea23fb0202f583
-- 
2.45.2





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#72566: [PATCH] services: mcron: Fix home version not respecting user PATH variable.
  2024-08-10 22:40 [bug#72566] [PATCH] services: mcron: Fix home version not respecting user PATH variable Sergio Pastor Pérez
@ 2024-08-28 14:26 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2024-08-28 14:26 UTC (permalink / raw)
  To: Sergio Pastor Pérez; +Cc: 72566-done

Hello,

Sergio Pastor Pérez <sergio.pastorperez@outlook.es> skribis:

> 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
> ---
> This patch makes `home-mcron-service-type' respect user's PATH environment
> variable, allowing to write jobs which refer to programs in PATH, instead of
> relying on writing the absolute path to those programs. Although jobs can be
> GEXPs, which facilitates writing those absolute paths, the programs they invoke
> can rely on the PATH environment variable to invoke other programs; for example,
> `notmuch' hooks.

Applied, thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-28 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-10 22:40 [bug#72566] [PATCH] services: mcron: Fix home version not respecting user PATH variable Sergio Pastor Pérez
2024-08-28 14:26 ` bug#72566: " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.