From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id WKGnGKHGJmTjVAEASxT56A (envelope-from ) for ; Fri, 31 Mar 2023 13:40:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gNeVF6HGJmQz0QAAG6o9tA (envelope-from ) for ; Fri, 31 Mar 2023 13:40:17 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2FB91441DB for ; Fri, 31 Mar 2023 13:40:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piD6z-0006WY-9P; Fri, 31 Mar 2023 07:40:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piD6x-0006Uo-Gb for guix-patches@gnu.org; Fri, 31 Mar 2023 07:40:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piD6x-0004sV-5R for guix-patches@gnu.org; Fri, 31 Mar 2023 07:40:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piD6w-0006CH-69 for guix-patches@gnu.org; Fri, 31 Mar 2023 07:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62102] [PATCH] services: Add whoogle-service-type. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 31 Mar 2023 11:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62102 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: conses Cc: 62102@debbugs.gnu.org, Andrew Tropin Received: via spool by 62102-submit@debbugs.gnu.org id=B62102.168026277523779 (code B ref 62102); Fri, 31 Mar 2023 11:40:02 +0000 Received: (at 62102) by debbugs.gnu.org; 31 Mar 2023 11:39:35 +0000 Received: from localhost ([127.0.0.1]:60542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piD6V-0006BS-GO for submit@debbugs.gnu.org; Fri, 31 Mar 2023 07:39:35 -0400 Received: from smtpm5.myservices.hosting ([185.26.105.236]:58986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piD6U-0006BK-9a for 62102@debbugs.gnu.org; Fri, 31 Mar 2023 07:39:34 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id A2D7920CB5; Fri, 31 Mar 2023 13:39:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 299E28009D; Fri, 31 Mar 2023 13:30:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id K3Guz6HBp3KT; Fri, 31 Mar 2023 13:30:18 +0200 (CEST) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id A74008009C; Fri, 31 Mar 2023 13:30:18 +0200 (CEST) Message-ID: <4c4ede32-0615-8134-0d47-ae18ed75531b@makinata.eu> Date: Fri, 31 Mar 2023 12:30:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Content-Language: en-US References: <86zg8k8iy8.fsf@conses.eu> From: Bruno Victal In-Reply-To: <86zg8k8iy8.fsf@conses.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680262817; a=rsa-sha256; cv=none; b=ddTie4hEIQw9tHKgMLT6QC70nyaI7QB7btA0/RWkAZH03tgocHMSry2yLcjrJr5B0eqfVI qrwve9kP6VhUWsb//NyZSe+WN+yVv8MvQyXriD/WjGitNQ/zhMDC2zCA+Un3H0CeiAgRvl NBeIti1TWzOy/26l506KIzLfONHf4dMKH5ExsP3OQPHnsVQL2NTUefQOEPGgR/7bvfyNw0 yWPgzgmAC85aiAjmPpsAsOLtKF0ECBN5nqc6rUGBCQLBD4WHv6AODPhp2eUpgwEA0Uufkc XGiGEl+FLUyxue66zD9PBsHcqRugvAM6fsb2XRakwUSOVLr28n3YnJNiguYe+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1680262817; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=3ZgZ1wJ17/+oWlPlQ1ckk6dhgVRtyLHCmzUQBXeXAgo=; b=hbnyFAgkAp3HaHSNvLXesFAvaiFqaUjDzemXE6/q/tS5X11Re4GeeOO8rTBLEJlxSFAv9I JHefB/r2zgQX2hsrVCIYVQNrqUumEI05UDrpTYRjh2GGU6IuY+YXd3GljbO/tI39eVPs4y GtiKhu2GV3zxXTPM46JzSMlS4PCdtEuGFmhZq44XJc7hAolaFRpf4COkUXwAANu5tZ2p1F A2T/XQ3jL0FkbrIurJLcnh49IQY3bGOdlCvm3Fi32SkZaHAurcOSfAoI9BVazDa2gQu5U5 t9fk7LCSxfWFmnNdBKnjluqTWvEdBm5OvmABiiVBNSyX+icdFvCACrKi+InvLw== X-Migadu-Spam-Score: -3.22 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Spam-Score: -3.22 X-Migadu-Queue-Id: 2FB91441DB X-TUID: 3s5qH0kevlVf 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)))) > > + 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