summary refs log tree commit diff
path: root/gnu/services/certbot.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/services/certbot.scm')
-rw-r--r--gnu/services/certbot.scm22
1 files changed, 14 insertions, 8 deletions
diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index a2a200f032..7548145c98 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -26,6 +26,7 @@
   #:use-module (gnu services web)
   #:use-module (gnu system shadow)
   #:use-module (gnu packages tls)
+  #:use-module (guix i18n)
   #:use-module (guix records)
   #:use-module (guix gexp)
   #:use-module (srfi srfi-1)
@@ -113,14 +114,19 @@
           #$(certbot-command config))))
 
 (define (certbot-activation config)
-  (match config
-    (($ <certbot-configuration> package webroot certificates email
-                                rsa-key-size default-location)
-     (with-imported-modules '((guix build utils))
-       #~(begin
-           (use-modules (guix build utils))
-           (mkdir-p #$webroot)
-           (zero? (system* #$(certbot-command config))))))))
+  (let* ((certbot-directory "/var/lib/certbot")
+         (script (in-vicinity certbot-directory "renew-certificates"))
+         (message (format #f (G_ "~a may need to be run~%") script)))
+    (match config
+      (($ <certbot-configuration> package webroot certificates email
+                                  rsa-key-size default-location)
+       (with-imported-modules '((guix build utils))
+         #~(begin
+             (use-modules (guix build utils))
+             (mkdir-p #$webroot)
+             (mkdir-p #$certbot-directory)
+             (copy-file #$(certbot-command config) #$script)
+             (display #$message)))))))
 
 (define certbot-nginx-server-configurations
   (match-lambda