[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/14: services: dicod: Pre-build the GCIDE index.
From: |
guix-commits |
Subject: |
02/14: services: dicod: Pre-build the GCIDE index. |
Date: |
Sun, 20 Aug 2023 17:22:25 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 9bfe7fbdbe51451d74a8fead5c1727d002050a52
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Aug 5 21:56:24 2023 +0200
services: dicod: Pre-build the GCIDE index.
* 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 @@
(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 @@ database {
(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 @@ database {
"/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 @@ database {
(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))
- branch master updated (78748c619a -> a0f5885fef), guix-commits, 2023/08/20
- 02/14: services: dicod: Pre-build the GCIDE index.,
guix-commits <=
- 04/14: services: Define 'for-home'., guix-commits, 2023/08/20
- 01/14: services: dicod: Remove Shepherd < 0.9.0 compatibility layer., guix-commits, 2023/08/20
- 06/14: home: services: mcron: Define as a mapping of the system service., guix-commits, 2023/08/20
- 08/14: home: services: Add Syncthing., guix-commits, 2023/08/20
- 09/14: home: services: ssh: Fix compilation warning with 'serialize-match-criteria'., guix-commits, 2023/08/20
- 11/14: gnu: Add python-ffmpeg-python., guix-commits, 2023/08/20
- 13/14: gnu: lttng-ust: Update to 2.13.6., guix-commits, 2023/08/20
- 14/14: doc: Fix module for "Essential Home Services"., guix-commits, 2023/08/20
- 03/14: services: syncthing: Use 'match-record'., guix-commits, 2023/08/20
- 05/14: home: services: Support mapping of System services to Home services., guix-commits, 2023/08/20