Subject: bug#61500: [PATCH] services: cat-http-server: Fix cat-avatar-generator-service.

From: Evgeny Pisemsky <[email-masked]>
Date: Thu, 30 Nov 2023 19:38:50 +0300

Here is the simplest patch that changes cache directory to /tmp/ and
makes this service work with the recently added monsterid package.
>From d6778a511cd5c41755a8ba9853d0e9db8dd47997 Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: Evgeny Pisemsky <[email-masked]>
Date: Thu, 30 Nov 2023 19:30:50 +0300
Subject: [PATCH] services: cat-http-server: Fix cat-avatar-generator-service.

* gnu/services/web.scm (cat-avatar-generator-service): Change default cache
directory of the service and make it compatible with the monsterid package.

Change-Id: I94b4b2d8b01e8502222e4fd2a6aea247d6480312
---
 doc/guix.texi        | 3 ++-
 gnu/services/web.scm | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1fd2e21608..95a2f05633 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -31752,7 +31752,7 @@ Web Services
 the hash of a user's email address.
 
 @deffn {Procedure} cat-avatar-generator-service @
-       [#:cache-dir "/var/cache/cat-avatar-generator"] @
+       [#:cache-dir "/tmp/"] @
        [#:package cat-avatar-generator] @
        [#:configuration (nginx-server-configuration)]
 Returns an nginx-server-configuration that inherits @code{configuration}.  It
@@ -31764,6 +31764,7 @@ Web Services
 A simple setup for cat-avatar-generator can look like this:
 @lisp
 (services (cons* (cat-avatar-generator-service
+                  #:package monsterid
                   #:configuration
                   (nginx-server-configuration
                     (server-name '("example.com"))))
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 818226a4f7..47ca1e6968 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -1158,7 +1158,7 @@ (define* (nginx-php-location
 
 (define* (cat-avatar-generator-service
           #:key
-          (cache-dir "/var/cache/cat-avatar-generator")
+          (cache-dir "/tmp/")
           (package cat-avatar-generator)
           (configuration (nginx-server-configuration)))
   (simple-service
@@ -1175,7 +1175,8 @@ (define* (cat-avatar-generator-service
                                 (nginx-location-configuration-body base)))))
                 (nginx-server-configuration-locations configuration)))
             (root #~(string-append #$package
-                                   "/share/web/cat-avatar-generator"))))))
+                                   "/share/web/"
+                                   #$(package-name package)))))))
 
 
 (define-record-type* <hpcguix-web-configuration>

base-commit: c12cf2fb63bc2a5b0c5419a372ff6fff76a28a3b
-- 
2.41.0