From 617a40eaebefc4b95725764e8bc2d11207c57c7a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 17 Mar 2023 17:12:01 -0300 Subject: queue.scm: Simplify Dovecot activation --- src/org/euandre/queue.scm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/org/euandre') diff --git a/src/org/euandre/queue.scm b/src/org/euandre/queue.scm index ab43649..ac91178 100644 --- a/src/org/euandre/queue.scm +++ b/src/org/euandre/queue.scm @@ -1470,23 +1470,23 @@ namespace inbox { (base-dir state-dir) #~(begin (use-modules (guix build utils)) - (let ((user (getpwnam "root"))) + (let ((user (getpwnam "root")) + (dhparam.pem (string-append #$state-dir "/dhparam.pem"))) (format (current-error-port) "Creating Dovecot base_dir directory: \"~a\".~%" #$base-dir) - (mkdir-p/perms #$base-dir user #o755) - (let ((dhparam.pem (string-append #$state-dir "/dhparam.pem"))) - (mkdir-p/perms #$state-dir user #o755) - (unless (file-exists? dhparam.pem) + (mkdir-p/perms #$base-dir user #o755) + (mkdir-p/perms #$state-dir user #o755) + (unless (file-exists? dhparam.pem) + (format (current-error-port) + "dhparam.pem file doesn't exist yet. Generating one...~%") + (cond + ((zero? (system* (string-append #$openssl "/bin/openssl") + "dhparam" "-out" dhparam.pem "2048")) + (format (current-error-port) + "Dovecot2 dhparam.pem file created: \"~a\".~%" dhparam.pem)) + (else (format (current-error-port) - "dhparam.pem file doesn't exist yet. Generating one...~%") - (cond - ((zero? (system* (string-append #$openssl "/bin/openssl") - "dhparam" "-out" dhparam.pem "2048")) - (format (current-error-port) - "Dovecot2 dhparam.pem file created: \"~a\".~%" dhparam.pem)) - (else - (format (current-error-port) - "Failed to create dhparam.pem file: \"~a\".~%" dhparam.pem))))))))) + "Failed to create dhparam.pem file: \"~a\".~%" dhparam.pem)))))))) (define (dovecot-shepherd-service config) (match-record config -- cgit v1.2.3