messages: Add download-message.
[software/mumi.git] / mumi / config.scm.in
1 ;;; mumi -- Mediocre, uh, mail interface
2 ;;; Copyright © 2017, 2018, 2019 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 #:use-module (debbugs)
20 #:export (%config))
21
22 (define %config
23 (let ((config
24 ;; Try to find the "assets" directory relative to the executable
25 ;; first. This is useful when using "pre-inst-env".
26 `((assets-dir . ,(let ((maybe-dir
27 (string-append (getcwd) "/assets")))
28 (if (and (getenv "MUMI_UNINSTALLED")
29 (file-exists? maybe-dir))
30 maybe-dir
31 ;; TODO: use @assetsdir@ variable here
32 "@prefix@/share/mumi/assets")))
33 (mail-dir . ,(let ((maybe-dir
34 (string-append (getcwd) "/mails")))
35 (if (and (getenv "MUMI_UNINSTALLED")
36 (file-exists? maybe-dir))
37 maybe-dir
38 (let ((dir "@localstatedir@/mumi/mails"))
39 (if (string-prefix? "${prefix}" dir)
40 (string-replace dir "@prefix@"
41 0 (string-length "${prefix}"))
42 dir)))))
43 (host . "localhost")
44 (port . 1234)
45 (submission-email-address . "guix-patches@gnu.org")
46 (submission-bug-email-address . "bug-guix@gnu.org")
47 (lists . '("guix-patches@gnu.org" "bug-guix@gnu.org"))
48 (packages . '("guix-patches" "guix"))
49 (debbugs . ,%gnu)
50 (debbugs-domain . "debbugs.gnu.org"))))
51 (lambda (key)
52 (assoc-ref config key))))