58b9a364262f1d92ad97ec3b85981d1e367b31e9
1 ;;; mumi -- Mediocre, uh, mail interface
2 ;;; Copyright © 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
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.
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.
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/>.
18 (define-module (mumi config
)
19 #:use-module
(debbugs)
23 (define mailer-enabled?
28 ;; Try to find the "assets" directory relative to the executable
29 ;; first. This is useful when using "pre-inst-env".
30 `((assets-dir .
,(let ((maybe-dir
31 (string-append (getcwd) "/assets")))
32 (if (and (getenv "MUMI_UNINSTALLED")
33 (file-exists? maybe-dir
))
35 ;; TODO: use @assetsdir@ variable here
36 "@prefix@/share/mumi/assets")))
37 (pkg-dir .
,(let ((maybe-dir
38 (string-append (getcwd) "/etc")))
39 (if (and (getenv "MUMI_UNINSTALLED")
40 (file-exists? maybe-dir
))
42 (let ((dir "@datarootdir@/mumi"))
43 (if (string-prefix?
"${prefix}" dir
)
44 (string-replace dir
"@prefix@"
45 0 (string-length "${prefix}"))
47 (db-dir .
,(let ((maybe-dir (getcwd)))
48 (if (and (getenv "MUMI_UNINSTALLED")
49 (file-exists? maybe-dir
))
51 (let ((dir "@localstatedir@/mumi/db"))
52 (if (string-prefix?
"${prefix}" dir
)
53 (string-replace dir
"@prefix@"
54 0 (string-length "${prefix}"))
56 (key-dir .
,(let ((maybe-dir (getcwd)))
57 (if (and (getenv "MUMI_UNINSTALLED")
58 (file-exists? maybe-dir
))
60 (let ((dir "@localstatedir@/mumi/"))
61 (if (string-prefix?
"${prefix}" dir
)
62 (string-replace dir
"@prefix@"
63 0 (string-length "${prefix}"))
65 (data-dir .
,(let ((maybe-dir
66 (string-append (getcwd) "/data")))
67 (if (and (getenv "MUMI_UNINSTALLED")
68 (file-exists? maybe-dir
))
70 (let ((dir "@localstatedir@/mumi/data"))
71 (if (string-prefix?
"${prefix}" dir
)
72 (string-replace dir
"@prefix@"
73 0 (string-length "${prefix}"))
78 (submission-email-address .
"guix-patches@gnu.org")
79 (submission-bug-email-address .
"bug-guix@gnu.org")
80 (lists .
("guix-patches@gnu.org" "bug-guix@gnu.org"))
81 (packages .
("guix-patches" "guix"))
83 (debbugs-domain .
"debbugs.gnu.org"))))
85 (assoc-ref config key
))))