config: Remove 'debbugs key.
[software/mumi.git] / mumi / config.scm.in
1 ;;; mumi -- Mediocre, uh, mail interface
2 ;;; Copyright © 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
3 ;;;
4 ;;; This program is free software: you can redistribute it and/or
5 ;;; modify it under the terms of the GNU Affero General Public License
6 ;;; as published by the Free Software Foundation, either version 3 of
7 ;;; the License, or (at your option) any later version.
8 ;;;
9 ;;; This program is distributed in the hope that it will be useful,
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;;; Affero General Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU Affero General Public
15 ;;; License along with this program. If not, see
16 ;;; <http://www.gnu.org/licenses/>.
17
18 (define-module (mumi config)
19 #:export (%config
20 mailer-enabled?))
21
22 (define mailer-enabled?
23 (make-parameter #t))
24
25 (define %config
26 (let ((config
27 ;; Try to find the "assets" directory relative to the executable
28 ;; first. This is useful when using "pre-inst-env".
29 `((assets-dir . ,(let ((maybe-dir
30 (string-append (getcwd) "/assets")))
31 (if (and (getenv "MUMI_UNINSTALLED")
32 (file-exists? maybe-dir))
33 maybe-dir
34 ;; TODO: use @assetsdir@ variable here
35 "@prefix@/share/mumi/assets")))
36 (pkg-dir . ,(let ((maybe-dir
37 (string-append (getcwd) "/etc")))
38 (if (and (getenv "MUMI_UNINSTALLED")
39 (file-exists? maybe-dir))
40 maybe-dir
41 (let ((dir "@datarootdir@/mumi"))
42 (if (string-prefix? "${prefix}" dir)
43 (string-replace dir "@prefix@"
44 0 (string-length "${prefix}"))
45 dir)))))
46 (db-dir . ,(let ((maybe-dir (getcwd)))
47 (if (and (getenv "MUMI_UNINSTALLED")
48 (file-exists? maybe-dir))
49 maybe-dir
50 (let ((dir "@localstatedir@/mumi/db"))
51 (if (string-prefix? "${prefix}" dir)
52 (string-replace dir "@prefix@"
53 0 (string-length "${prefix}"))
54 dir)))))
55 (key-dir . ,(let ((maybe-dir (getcwd)))
56 (if (and (getenv "MUMI_UNINSTALLED")
57 (file-exists? maybe-dir))
58 maybe-dir
59 (let ((dir "@localstatedir@/mumi/"))
60 (if (string-prefix? "${prefix}" dir)
61 (string-replace dir "@prefix@"
62 0 (string-length "${prefix}"))
63 dir)))))
64 (data-dir . ,(let ((maybe-dir
65 (string-append (getcwd) "/data")))
66 (if (and (getenv "MUMI_UNINSTALLED")
67 (file-exists? maybe-dir))
68 maybe-dir
69 (let ((dir "@localstatedir@/mumi/data"))
70 (if (string-prefix? "${prefix}" dir)
71 (string-replace dir "@prefix@"
72 0 (string-length "${prefix}"))
73 dir)))))
74 (host . "localhost")
75 (port . 1234)
76 (cache-ttl . 120)
77 (submission-email-address . "guix-patches@gnu.org")
78 (submission-bug-email-address . "bug-guix@gnu.org")
79 (lists . ("guix-patches@gnu.org" "bug-guix@gnu.org"))
80 (packages . ("guix-patches" "guix"))
81 (debbugs-domain . "debbugs.gnu.org"))))
82 (lambda (key)
83 (assoc-ref config key))))