From 69c471d4ebe6a24fe11e6488f93616a7afb4467a Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Sat, 13 May 2017 20:27:15 +1000 Subject: [PATCH 2/2] services: Change exim-service-type to use define-service-type. * gnu/services/mail.scm: Refactor code to use define-service-type. --- gnu/services/mail.scm | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index 6305f06f8..ebc7e3d9e 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -1693,14 +1693,6 @@ accept from local for any relay ;;; Exim. ;;; -(define-record-type* exim-configuration - make-exim-configuration - exim-configuration? - (package exim-configuration-package ; - (default exim)) - (config-file exim-configuration-config-file ;file-like - (default #f))) - (define %exim-accounts (list (user-group (name "exim") @@ -1752,15 +1744,16 @@ exim_group = exim (zero? (system* #$(file-append package "/bin/exim") "-bV" "-C" #$(exim-computed-config-file package config-file)))))))) -(define exim-profile - (compose list exim-configuration-package)) - -(define exim-service-type - (service-type - (name 'exim) - (extensions - (list (service-extension shepherd-root-service-type exim-shepherd-service) - (service-extension account-service-type (const %exim-accounts)) - (service-extension activation-service-type exim-activation) - (service-extension profile-service-type exim-profile) - (service-extension mail-aliases-service-type (const '())))))) +(define (exim-profile config) + (call-with-values (lambda () (exim-configuration-package config)) list)) + +(define-service-type exim + (extensions (list + (service-extension shepherd-root-service-type exim-shepherd-service) + (service-extension account-service-type (const %exim-accounts)) + (service-extension activation-service-type exim-activation) + (service-extension profile-service-type exim-profile) + (service-extension mail-aliases-service-type (const '())))) + (configuration + (package (default exim)) + (config-file (default #f)))) -- 2.12.2