diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-11-19 17:37:24 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-12-02 00:02:13 +0100 |
commit | 4c8eea027a60d0be345770333dfda4c0d6230247 (patch) | |
tree | edfdf32031f273c360ceb591cc8de2d0183cb552 /gnu/home/services/mcron.scm | |
parent | cc9ee514e37f6ec74dd9cab91a13d51f7b8d47e7 (diff) |
home: services: Use 'match-record' instead of 'match'.
* gnu/home/services/mcron.scm (home-mcron-shepherd-services): Use
'match-record' instead of 'match'.
* gnu/home/services/shells.scm (home-bash-extensions): Likewise.
* gnu/home/services/xdg.scm (serialize-xdg-desktop-entry): Likewise.
Diffstat (limited to 'gnu/home/services/mcron.scm')
-rw-r--r-- | gnu/home/services/mcron.scm | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/gnu/home/services/mcron.scm b/gnu/home/services/mcron.scm index 1d294a997c..5f35bfe054 100644 --- a/gnu/home/services/mcron.scm +++ b/gnu/home/services/mcron.scm @@ -77,35 +77,35 @@ Each message is also prefixed by a timestamp by GNU Shepherd.")) (define shepherd-schedule-action (@@ (gnu services mcron) shepherd-schedule-action)) -(define home-mcron-shepherd-services - (match-lambda - (($ <home-mcron-configuration> mcron '()) ; no jobs to run - '()) - (($ <home-mcron-configuration> mcron jobs log? log-format) - (let ((files (job-files mcron jobs))) - (list (shepherd-service - (documentation "User cron jobs.") - (provision '(mcron)) - (modules `((srfi srfi-1) - (srfi srfi-26) - (ice-9 popen) ; for the 'schedule' action - (ice-9 rdelim) - (ice-9 match) - ,@%default-modules)) - (start #~(make-forkexec-constructor - (list (string-append #$mcron "/bin/mcron") - #$@(if log? - #~("--log" "--log-format" #$log-format) - #~()) - #$@files) - #:log-file (string-append - (or (getenv "XDG_LOG_HOME") - (format #f "~a/.local/var/log" - (getenv "HOME"))) - "/mcron.log"))) - (stop #~(make-kill-destructor)) - (actions - (list (shepherd-schedule-action mcron files))))))))) +(define (home-mcron-shepherd-services config) + (match-record config <home-mcron-configuration> + (mcron jobs log? log-format) + (if (null? jobs) + '() ;no jobs to run + (let ((files (job-files mcron jobs))) + (list (shepherd-service + (documentation "User cron jobs.") + (provision '(mcron)) + (modules `((srfi srfi-1) + (srfi srfi-26) + (ice-9 popen) ;for the 'schedule' action + (ice-9 rdelim) + (ice-9 match) + ,@%default-modules)) + (start #~(make-forkexec-constructor + (list (string-append #$mcron "/bin/mcron") + #$@(if log? + #~("--log" "--log-format" #$log-format) + #~()) + #$@files) + #:log-file (string-append + (or (getenv "XDG_LOG_HOME") + (format #f "~a/.local/var/log" + (getenv "HOME"))) + "/mcron.log"))) + (stop #~(make-kill-destructor)) + (actions + (list (shepherd-schedule-action mcron files))))))))) (define home-mcron-profile (compose list home-mcron-configuration-mcron)) |