From patchwork Sun Mar 1 21:13:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 20491 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7CF5227BBEA; Sun, 1 Mar 2020 21:14:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 4C94327BBE4 for ; Sun, 1 Mar 2020 21:14:11 +0000 (GMT) Received: from localhost ([::1]:51874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8Vuc-0001Ap-Rh for patchwork@mira.cbaines.net; Sun, 01 Mar 2020 16:14:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53989) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8VuV-0001A2-Dw for guix-patches@gnu.org; Sun, 01 Mar 2020 16:14:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j8VuU-00033o-DS for guix-patches@gnu.org; Sun, 01 Mar 2020 16:14:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59298) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j8VuU-00033i-AA for guix-patches@gnu.org; Sun, 01 Mar 2020 16:14:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j8VuU-0007kI-4r for guix-patches@gnu.org; Sun, 01 Mar 2020 16:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#39864] [PATCH 2/2] services: guix-data-service: Allow passing extra options. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 01 Mar 2020 21:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39864 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 39864@debbugs.gnu.org Received: via spool by 39864-submit@debbugs.gnu.org id=B39864.158309721629715 (code B ref 39864); Sun, 01 Mar 2020 21:14:02 +0000 Received: (at 39864) by debbugs.gnu.org; 1 Mar 2020 21:13:36 +0000 Received: from localhost ([127.0.0.1]:37036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8Vu4-0007jB-5q for submit@debbugs.gnu.org; Sun, 01 Mar 2020 16:13:36 -0500 Received: from mira.cbaines.net ([212.71.252.8]:47372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8Vu2-0007iy-VM for 39864@debbugs.gnu.org; Sun, 01 Mar 2020 16:13:35 -0500 Received: from localhost (unknown [46.237.162.11]) by mira.cbaines.net (Postfix) with ESMTPSA id 40C2927BBEA for <39864@debbugs.gnu.org>; Sun, 1 Mar 2020 21:13:34 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id c1ab640a for <39864@debbugs.gnu.org>; Sun, 1 Mar 2020 21:13:31 +0000 (UTC) From: Christopher Baines Date: Sun, 1 Mar 2020 21:13:31 +0000 Message-Id: <20200301211331.21163-2-mail@cbaines.net> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200301211331.21163-1-mail@cbaines.net> References: <20200301211331.21163-1-mail@cbaines.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This is so that the options supported by the service configuration don't have to always be changed. Generally though all options should be explicitly supported and documented, so this is mostly to facilitate experimentation. * gnu/services/guix.scm (): Add extra-options and extra-process-jobs-options to the record type. (guix-data-service-shepherd-services): Handle these new configuration record fields. * doc/guix.texi (Guix Data Service): Document these new options. --- doc/guix.texi | 6 ++++++ gnu/services/guix.scm | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index fab9159530..80ba8a488e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -25245,6 +25245,12 @@ If set, this is the @code{getmail-retriever-configuration} object with which to configure getmail to fetch mail from the guix-commits mailing list. +@item @code{extra-options} (default: @var{'()}) +Extra command line options for @code{guix-data-service}. + +@item @code{extra-process-jobs-options} (default: @var{'()}) +Extra command line options for @code{guix-data-service-process-jobs}. + @end table @end deftp diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm index 0f0fad39b0..10a8581a62 100644 --- a/gnu/services/guix.scm +++ b/gnu/services/guix.scm @@ -68,7 +68,12 @@ (default #f)) (commits-getmail-retriever-configuration guix-data-service-commits-getmail-retriever-configuration - (default #f))) + (default #f)) + (extra-options guix-data-service-extra-options + (default '())) + (extra-process-jobs-options + guix-data-service-extra-process-jobs-options + (default '()))) (define (guix-data-service-profile-packages config) "Return the guix-data-service package, this will populate the @@ -78,7 +83,7 @@ ca-certificates.crt file in the system profile." (define (guix-data-service-shepherd-services config) (match-record config - (package user group port host) + (package user group port host extra-options extra-process-jobs-options) (list (shepherd-service (documentation "Guix Data Service web server") @@ -92,7 +97,8 @@ ca-certificates.crt file in the system profile." #$(string-append "--host=" host) ;; Perform any database migrations when the ;; service is started - "--update-database") + "--update-database" + #$@extra-options) #:user #$user #:group #$group @@ -117,7 +123,8 @@ ca-certificates.crt file in the system profile." (start #~(make-forkexec-constructor (list #$(file-append package - "/bin/guix-data-service-process-jobs")) + "/bin/guix-data-service-process-jobs") + #$@extra-process-jobs-options) #:user #$user #:group #$group #:environment-variables