1 ;;; mumi -- Mediocre, uh, mail interface
2 ;;; Copyright © 2017, 2018, 2019 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)
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
))
31 ;; TODO: use @assetsdir@ variable here
32 "@prefix@/share/mumi/assets")))
33 (pkg-dir .
,(let ((maybe-dir
34 (string-append (getcwd) "/etc")))
35 (if (and (getenv "MUMI_UNINSTALLED")
36 (file-exists? maybe-dir
))
38 (let ((dir "@datarootdir@/mumi"))
39 (if (string-prefix?
"${prefix}" dir
)
40 (string-replace dir
"@prefix@"
41 0 (string-length "${prefix}"))
43 (db-dir .
,(let ((maybe-dir (getcwd)))
44 (if (and (getenv "MUMI_UNINSTALLED")
45 (file-exists? maybe-dir
))
47 (let ((dir "@localstatedir@/mumi/db"))
48 (if (string-prefix?
"${prefix}" dir
)
49 (string-replace dir
"@prefix@"
50 0 (string-length "${prefix}"))
52 (mail-dir .
,(let ((maybe-dir
53 (string-append (getcwd) "/mails")))
54 (if (and (getenv "MUMI_UNINSTALLED")
55 (file-exists? maybe-dir
))
57 (let ((dir "@localstatedir@/mumi/mails"))
58 (if (string-prefix?
"${prefix}" dir
)
59 (string-replace dir
"@prefix@"
60 0 (string-length "${prefix}"))
64 (submission-email-address .
"guix-patches@gnu.org")
65 (submission-bug-email-address .
"bug-guix@gnu.org")
66 (lists .
("guix-patches@gnu.org" "bug-guix@gnu.org"))
67 (packages .
("guix-patches" "guix"))
68 (mu-executable .
"@MUMIMU@")
70 (debbugs-domain .
"debbugs.gnu.org"))))
72 (assoc-ref config key
))))