From: "Miguel Ángel Moreno" <contact@conses.eu>
To: 62102@debbugs.gnu.org
Subject: [bug#62102] [PATCH] services: Add whoogle-service-type.
Date: Fri, 09 Jun 2023 23:07:02 +0200 [thread overview]
Message-ID: <863530fiq1.fsf@conses.eu> (raw)
In-Reply-To: <87ttvgtkjs.fsf_-_@gnu.org> ("Ludovic Courtès"'s message of "Fri, 09 Jun 2023 23:03:51 +0200")
On 2023-06-09 23:03, Ludovic Courtès wrote:
> Hi conses,
>
> Did you have a chance to look into Bruno’s suggestions below?
>
> Please let us know what you think.
>
Hey Ludovic,
Yes, I've noted them but I haven't gotten around to implementing them
yet. I'll give this a shot soon.
>
> Bruno Victal <mirai@makinata.eu> skribis:
>
>> Hi,
>>
>> On 2023-03-10 20:11, conses wrote:
>>>
>>> + whoogle-service-type
>>> + whoogle-configuration
>>> +
>>
>> [...]
>>
>>> patchwork-database-configuration
>>> patchwork-database-configuration?
>>> patchwork-database-configuration-engine
>>> @@ -1575,6 +1580,47 @@ (define varnish-service-type
>>> (default-value
>>> (varnish-configuration))))
>>>
>>> +\f
>>
>> Missing page-break character here?
>> If you're using Emacs you can insert one with C-q C-l.
>>
>>> +;;;
>>> +;;; Whoogle
>>> +;;;
>>> +
>>> +(define-configuration/no-serialization whoogle-configuration
>>> + (whoogle
>>> + (package whoogle-search)
>>> + "The @code{whoogle-search} package to use."))
>>
>> I prefer this field to be named 'package' instead, to make it less prone
>> to confusion. The accessor, whoogle-configuration-package, should be exported
>> as well.
>>
>>> +(define (whoogle-shepherd-service config)
>>> + (list
>>> + (shepherd-service
>>> + (provision '(whoogle-search))
>>> + (start #~(make-forkexec-constructor
>>> + (list (string-append #$(whoogle-configuration-whoogle config)
>>> + "/bin/whoogle-search"))
>>
>> In general, you may prefer to use match-record instead of using accessors
>> as it results in much less code to type.
>>
>>> + #:environment-variables
>>> + (append (list "CONFIG_VOLUME=/var/cache/whoogle-search")
>>> + (default-environment-variables))))
>>
>> Is (default-environment-variables) necessary?
>>
>>> + (stop #~(make-kill-destructor))
>>> + (documentation "Run a @code{whoogle-search} instance."))))
>>> +
>>> +(define (whoogle-profile-service config)
>>> + (list
>>> + (whoogle-configuration-whoogle config)))
>>
>> [...]
>>
>>> +
>>> +(define whoogle-service-type
>>> + (service-type
>>> + (name 'whoogle-search)
>>> + (extensions
>>> + (list
>>> + (service-extension
>>> + shepherd-root-service-type
>>> + whoogle-shepherd-service)
>>> + (service-extension
>>> + profile-service-type
>>> + whoogle-profile-service)))
>>
>> You can use match-record here or use the accessor here instead.
>> (e.g., (compose list whoogle-configuration-package))
>>
>>
>> Could you add a system test for this service as well?
>> It makes things easier to check and maintain.
>>
>>
>> Cheers,
>> Bruno
--
Best regards,
Miguel Ángel Moreno
next prev parent reply other threads:[~2023-06-09 21:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 20:11 [bug#62102] [PATCH] services: Add whoogle-service-type conses
2023-03-31 11:30 ` Bruno Victal
2023-06-09 21:03 ` Ludovic Courtès
2023-06-09 21:07 ` Miguel Ángel Moreno [this message]
2023-08-08 15:26 ` Ludovic Courtès
2023-08-13 10:57 ` Miguel Ángel Moreno
2023-08-13 10:37 ` [bug#62102] [PATCH v2] " Miguel Ángel Moreno
2024-02-19 21:25 ` Ludovic Courtès
2024-02-11 20:34 ` [bug#62102] [PATCH] " Miguel Ángel Moreno
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=863530fiq1.fsf@conses.eu \
--to=contact@conses.eu \
--cc=62102@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).