unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: 39864@debbugs.gnu.org
Subject: [bug#39864] [PATCH 2/2] services: guix-data-service: Allow passing extra options.
Date: Sun,  1 Mar 2020 21:13:31 +0000	[thread overview]
Message-ID: <20200301211331.21163-2-mail@cbaines.net> (raw)
In-Reply-To: <20200301211331.21163-1-mail@cbaines.net>

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 (<guix-data-service-configuration>): 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 <guix-data-service-configuration>
-    (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
-- 
2.25.0

  reply	other threads:[~2020-03-01 21:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 21:01 [bug#39864] [PATCH 0/2] Update the Guix Data Service package, and tweak the service Christopher Baines
2020-03-01 21:13 ` [bug#39864] [PATCH 1/2] gnu: guix-data-service: Update to 0.0.1-18.18eb9df Christopher Baines
2020-03-01 21:13   ` Christopher Baines [this message]
2020-03-07 21:20 ` [bug#39864] [PATCH 0/2] Update the Guix Data Service package, and tweak the service Ludovic Courtès
2020-03-08 23:43   ` bug#39864: " Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200301211331.21163-2-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=39864@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).