unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 2d745baa5d49a1ef978cc65eeddc43658127cb44 3791 bytes (raw)
name: gnu/home/services/dict.scm 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
(define-module (gnu home services dict)
  #:use-module (srfi srfi-1)
  #:use-module (guix gexp)
  #:use-module (guix least-authority)
  #:use-module (gnu build linux-container)
  #:use-module (gnu home services)
  #:use-module (gnu home services shepherd)
  #:use-module (gnu packages dictionaries)
  #:use-module (gnu services dict)
  #:use-module (gnu system file-systems)

  #:export (%home-dicod-database:gcide
            %home-dicod-configuration
            home-dicod-service-type))

(define dico-run-time-dir "/tmp/dico")

(define %home-dicod-database:gcide
  (dicod-database
   (name "gcide")
   (handler "gcide")
   (options (list #~(string-append "dbdir=" #$gcide "/share/gcide")
                  #~(string-append "idxdir=" #$dico-run-time-dir)))))

(define %home-dicod-configuration
  (dicod-configuration
   (databases (list %home-dicod-database:gcide))))

(define %home-dicod-activation
  #~(begin
      (use-modules (guix build utils))
      (mkdir-p #$dico-run-time-dir)))

(define (home-dicod-shepherd-service config)
  (let* ((dicod.conf ((@@ (gnu services dict) dicod-configuration-file) config))
         (interfaces ((@@ (gnu services dict) dicod-configuration-interfaces) config))
         (dicod      (least-authority-wrapper
                      (file-append
                       ((@@ (gnu services dict) dicod-configuration-dico) config) "/bin/dicod")
                      #:name "dicod"
                      #:mappings (list (file-system-mapping
                                        (source dico-run-time-dir)
                                        (target source)
                                        (writable? #t))
                                       (file-system-mapping
                                        (source "/dev/log")
                                        (target source))
                                       (file-system-mapping
                                        (source dicod.conf)
                                        (target source)))
                      #:namespaces (delq 'net %namespaces))))
    (list (shepherd-service
           (provision '(dicod))
           (documentation "Run the dicod daemon.")
           (start #~(if (and (defined? 'make-inetd-constructor)
                             #$(= 1 (length interfaces))) ;XXX
                        (make-inetd-constructor
                         (list #$dicod "--inetd" "--foreground"
                               (string-append "--config=" #$dicod.conf))
                         (addrinfo:addr
                          (car (getaddrinfo #$(first interfaces) "dict")))
                         #:service-name-stem "dicod")
                        (make-forkexec-constructor
                         (list #$dicod "--foreground"
                               (string-append "--config=" #$dicod.conf)))))
           (stop #~(if (and (defined? 'make-inetd-destructor)
                            #$(= 1 (length interfaces))) ;XXX
                       (make-inetd-destructor)
                       (make-kill-destructor)))
           (actions (list (shepherd-configuration-action dicod.conf)))))))

(define home-dicod-service-type
  (service-type
   (name 'home-dicod)
   (extensions (list (service-extension home-shepherd-service-type
                                        home-dicod-shepherd-service)
                     (service-extension home-activation-service-type
                                        (const %home-dicod-activation))))
   (default-value %home-dicod-configuration)
   (description
    "Run @command{dicod}, the dictionary server of
@uref{https://www.gnu.org/software/dico, GNU Dico}.  @command{dicod}
implements the standard DICT protocol supported by clients such as
@command{dico} and GNOME Dictionary as a user.")))

debug log:

solving 2d745baa5d ...
found 2d745baa5d in https://yhetil.org/guix-patches/87leh9d6o5.fsf@librem.one/

applying [1/1] https://yhetil.org/guix-patches/87leh9d6o5.fsf@librem.one/
diff --git a/gnu/home/services/dict.scm b/gnu/home/services/dict.scm
new file mode 100644
index 0000000000..2d745baa5d

Checking patch gnu/home/services/dict.scm...
Applied patch gnu/home/services/dict.scm cleanly.

index at:
100644 2d745baa5d49a1ef978cc65eeddc43658127cb44	gnu/home/services/dict.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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