From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Hill Subject: Re: Problem with building service from my channel Date: Wed, 12 Jun 2019 20:47:08 -0400 (EDT) Message-ID: References: <87k1ds1khy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54417) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbDtY-00026j-K1 for help-guix@gnu.org; Wed, 12 Jun 2019 20:47:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbDtX-0005Pz-7T for help-guix@gnu.org; Wed, 12 Jun 2019 20:47:12 -0400 In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: =?ISO-8859-15?Q?Ludovic_Court=E8s?= Cc: help-guix@gnu.org 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 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 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 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.")))