mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 14:28:15 -05:00
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.
This commit is contained in:
parent
171ab374f9
commit
9bfe7fbdbe
1 changed files with 13 additions and 15 deletions
|
@ -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 configuration->text
|
|||
|
||||
(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))
|
||||
|
|
Loading…
Reference in a new issue