help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with building service from my channel


From: Jack Hill
Subject: Re: Problem with building service from my channel
Date: Wed, 12 Jun 2019 20:47:08 -0400 (EDT)
User-agent: Alpine 2.20 (DEB 67 2015-01-07)

On Tue, 11 Jun 2019, Jack Hill wrote:

Here's where I define a service that extends mcron-service-type

I copied the code for this service from my channel into an arbitrary service file in the guix repository, hoping for a different message that would provide more insight. To my surprise, it build sucessfully, and I as able to sucessfully search for my service using `./pre-inst-env guix system search`.

Ideas?

Here's the patch that I added to guix:

From c91455049a4bd5eca9f3128135c000d6d881a23a Mon Sep 17 00:00:00 2001
From: Jack Hill <address@hidden>
Date: Wed, 12 Jun 2019 20:38:13 -0400
Subject: [PATCH] test commit

---
 gnu/services/certbot.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/services/certbot.scm b/gnu/services/certbot.scm
index ae34ad17bb..ecca5f360b 100644
--- a/gnu/services/certbot.scm
+++ b/gnu/services/certbot.scm
@@ -27,6 +27,7 @@
   #:use-module (gnu services web)
   #:use-module (gnu system shadow)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages certs)
   #:use-module (guix i18n)
   #:use-module (guix records)
   #:use-module (guix gexp)
@@ -35,7 +36,10 @@
   #:export (certbot-service-type
             certbot-configuration
             certbot-configuration?
-            certificate-configuration))
+            certificate-configuration
+            planisphere-report-configuration
+           planisphere-report-configuration?
+           planisphere-report-service-type))

 ;;; Commentary:
 ;;;
@@ -190,3 +194,29 @@
                  "Automatically renew @url{https://letsencrypt.org, Let's
 Encrypt} HTTPS certificates by adjusting the nginx web server configuration
 and periodically invoking @command{certbot}.")))
+
+(define-record-type* <planisphere-report-configuration>
+  planisphere-report-configuration make-planisphere-report-configuration
+  planisphere-report-configuration?
+  (certs planisphere-report-certs
+        (default nss-certs))
+  (package planisphere-report-package
+          (default nss-certs))
+  (schedule planisphere-report-schedule
+           (default '(quote (next-minute-from (next-hour '(0 12)) (list 
(random 60)))))))
+
+(define (planisphere-report-jobs config)
+  (let ((sched-spec (planisphere-report-schedule config))
+       (certs (file-append (planisphere-report-certs config) "/etc/ssl/certs"))
+       (cmd (file-append (planisphere-report-package config) 
"/bin/planisphere-report")))
+    (list
+     #~(append-environment-mods "SSL_CERT_DIR" #$certs)
+     #~(job #$sched-spec #$cmd))))
+
+(define planisphere-report-service-type
+  (service-type
+   (name 'planisphere-report)
+   (extensions
+    (list (service-extension mcron-service-type planisphere-report-jobs)))
+   (default-value (planisphere-report-configuration))
+   (description "Periodically run @command{planisphere-report} to update the OIT 
endpoint database.")))
--
2.21.0

compared to the service in my channel

(define-module (guix-at-duke services endpoint-management)
  #:use-module (gnu services)
  #:use-module (gnu services mcron)
  #:use-module (guix gexp)
  #:use-module (guix records)
  #:use-module (guix-at-duke packages endpoint-management)
  #:export (planisphere-report-configuration
            planisphere-report-configuration?
            planisphere-report-service-type))

(define-record-type* <planisphere-report-configuration>
  planisphere-report-configuration make-planisphere-report-configuration
  planisphere-report-configuration?
  (package planisphere-report-package
           (default planisphere-report))
  (schedule planisphere-report-schedule
            (default '(quote (next-minute-from (next-hour '(0 12)) (list 
(random 60)))))))

(define (planisphere-report-jobs config)
  (let ((sched-spec (planisphere-report-schedule config))
        (cmd (file-append (planisphere-report-package config) 
"/bin/planisphere-report")))
    (list
     #~(job #$sched-spec #$cmd))))

(define planisphere-report-service-type
  (service-type
   (name 'planisphere-report)
   (extensions
    (list (service-extension mcron-service-type planisphere-report-jobs)))
   (default-value (planisphere-report-configuration))
   (description "Periodically run @command{planisphere-report} to update the OIT 
endpoint database.")))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]