From: "Ludovic Courtès" <ludo@gnu.org>
To: 65119@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#65119] [PATCH 2/8] services: dicod: Pre-build the GCIDE index.
Date: Sun, 6 Aug 2023 23:07:29 +0200 [thread overview]
Message-ID: <e885dd784b857cf88c5bed519e91d3856248b805.1691355218.git.ludo@gnu.org> (raw)
In-Reply-To: <cover.1691355218.git.ludo@gnu.org>
* gnu/services/dict.scm (%dicod-gcide-index): New variable.
(%dicod-database:gcide): Use it.
(%dicod-activation): Remove.
(dicod-shepherd-service): Remove reference to /var/run/dicod.
(dicod-service-type): Remove ACTIVATION-SERVICE-TYPE extension.
---
gnu/services/dict.scm | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/gnu/services/dict.scm b/gnu/services/dict.scm
index 7d48953ef1..f542921302 100644
--- a/gnu/services/dict.scm
+++ b/gnu/services/dict.scm
@@ -73,12 +73,24 @@ (define-record-type* <dicod-database>
(complex? dicod-database-complex? (default #f))
(options dicod-database-options (default '())))
+(define %dicod-gcide-index
+ ;; The GCIDE pre-built index. The Dico 'gcide' module can build it lazily;
+ ;; do it upfront so there's no need for a writable directory at run-time.
+ (computed-file "dicod-gcide-index"
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+ (mkdir #$output)
+ (invoke #+(file-append dico "/libexec/idxgcide")
+ #+(file-append gcide "/share/gcide")
+ #$output)))))
+
(define %dicod-database:gcide
(dicod-database
(name "gcide")
(handler "gcide")
(options (list #~(string-append "dbdir=" #$gcide "/share/gcide")
- "idxdir=/var/run/dicod"))))
+ #~(string-append "idxdir=" #$%dicod-gcide-index)))))
(define %dicod-accounts
(list (user-group
@@ -137,14 +149,6 @@ (define (dicod-configuration-file config)
(apply mixed-text-file "dicod.conf" (configuration->text config)))
-(define %dicod-activation
- #~(begin
- (use-modules (guix build utils))
- (let ((user (getpwnam "dicod"))
- (rundir "/var/run/dicod"))
- (mkdir-p rundir)
- (chown rundir (passwd:uid user) (passwd:gid user)))))
-
(define (dicod-shepherd-service config)
(let* ((dicod.conf (dicod-configuration-file config))
(interfaces (dicod-configuration-interfaces config))
@@ -153,10 +157,6 @@ (define (dicod-shepherd-service config)
"/bin/dicod")
#:name "dicod"
#:mappings (list (file-system-mapping
- (source "/var/run/dicod")
- (target source)
- (writable? #t))
- (file-system-mapping
(source "/dev/log")
(target source))
(file-system-mapping
@@ -187,8 +187,6 @@ (define dicod-service-type
(extensions
(list (service-extension account-service-type
(const %dicod-accounts))
- (service-extension activation-service-type
- (const %dicod-activation))
(service-extension shepherd-root-service-type
dicod-shepherd-service)))
(default-value (dicod-configuration))
--
2.41.0
next prev parent reply other threads:[~2023-08-06 21:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-06 21:04 [bug#65119] [PATCH 0/8] Sharing service code between Home and System Ludovic Courtès
2023-08-06 21:07 ` [bug#65119] [PATCH 1/8] services: dicod: Remove Shepherd < 0.9.0 compatibility layer Ludovic Courtès
2023-08-06 21:07 ` Ludovic Courtès [this message]
2023-08-06 21:07 ` [bug#65119] [PATCH 3/8] services: syncthing: Use 'match-record' Ludovic Courtès
2023-08-06 21:07 ` [bug#65119] [PATCH 4/8] services: Define 'for-home' Ludovic Courtès
2023-08-06 21:07 ` [bug#65119] [PATCH 5/8] home: services: Support mapping of System services to Home services Ludovic Courtès
2023-08-06 21:07 ` [bug#65119] [PATCH 6/8] home: services: mcron: Define as a mapping of the system service Ludovic Courtès
2023-08-21 15:50 ` Andrew Tropin
2023-08-06 21:07 ` [bug#65119] [PATCH 7/8] home: services: Add dicod Ludovic Courtès
2023-08-06 21:07 ` [bug#65119] [PATCH 8/8] home: services: Add Syncthing Ludovic Courtès
2023-08-13 5:28 ` [bug#65119] [PATCH 0/8] Sharing service code between Home and System 宋文武 via Guix-patches via
2023-08-20 21:23 ` bug#65119: " Ludovic Courtès
2023-08-21 13:43 ` [bug#65119] " Andrew Tropin
2023-08-22 16:25 ` Ludovic Courtès
2023-08-25 6:28 ` Andrew Tropin
2023-09-08 12:42 ` Andrew Tropin
2023-09-08 22:18 ` Ludovic Courtès
2023-09-09 10:42 ` Andrew Tropin
2023-09-13 18:06 ` Ludovic Courtès
2023-09-17 5:28 ` Andrew Tropin
2023-09-17 10:27 ` Ludovic Courtès
2023-09-13 19:55 ` Ludovic Courtès
2023-09-17 7:01 ` Andrew Tropin
2023-10-13 16:05 ` Ludovic Courtès
2023-10-14 6:03 ` Andrew Tropin
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e885dd784b857cf88c5bed519e91d3856248b805.1691355218.git.ludo@gnu.org \
--to=ludo@gnu.org \
--cc=65119@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.