unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#62102] [PATCH] services: Add whoogle-service-type.
@ 2023-03-10 20:11 conses
  2023-03-31 11:30 ` Bruno Victal
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: conses @ 2023-03-10 20:11 UTC (permalink / raw)
  To: 62102; +Cc: contact, Andrew Tropin

---
 gnu/services/web.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index d56e893527..66cc640a6d 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -35,6 +35,7 @@ (define-module (gnu services web)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services admin)
+  #:use-module (gnu services configuration)
   #:use-module (gnu services getmail)
   #:use-module (gnu services mail)
   #:use-module (gnu system pam)
@@ -46,6 +47,7 @@ (define-module (gnu services web)
   #:use-module (gnu packages patchutils)
   #:use-module (gnu packages php)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-web)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages logging)
@@ -235,6 +237,9 @@ (define-module (gnu services web)
 
             varnish-service-type
 
+            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
+;;;
+;;; Whoogle
+;;;
+
+(define-configuration/no-serialization whoogle-configuration
+  (whoogle
+    (package whoogle-search)
+    "The @code{whoogle-search} package to use."))
+
+(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"))
+              #:environment-variables
+              (append (list "CONFIG_VOLUME=/var/cache/whoogle-search")
+                      (default-environment-variables))))
+    (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)))
+   (default-value (whoogle-configuration))
+   (description "Run the @code{whoogle-search} engine.")))
+
 \f
 ;;;
 ;;; Patchwork
-- 
2.39.1



-- 
Best regards,
conses




^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-19 21:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).