summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinglu Chen <public@yoctocell.xyz>2021-03-07 10:38:14 +0100
committerDavid Thompson <dthompson@vistahigherlearning.com>2021-03-18 10:32:44 -0400
commit166d5718790f6457a88cbaf9699cb551d13b0587 (patch)
treed1108a1dd882b9ea209885dac499d849f9233d0d
parent1f4c1ccee8cd9e54290b35b023ea8422762eec16 (diff)
ui: Make database and config files configurable.
It will fallback to the legacy paths, maintaining backward compatibility. * shroud/ui.scm (%default-config): Read environment variable to determine database file. (load-config): Read environment variable to determine config file.
-rw-r--r--shroud/ui.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/shroud/ui.scm b/shroud/ui.scm
index ab78010..31c66fa 100644
--- a/shroud/ui.scm
+++ b/shroud/ui.scm
@@ -115,12 +115,14 @@ ARGS is the list of arguments received by the 'throw' handler."
(report-load-error file args))))
(define %default-config
- `((database-file . ,(string-append (getenv "HOME") "/.config/shroud/db.gpg"))
+ `((database-file . ,(or (getenv "SHROUD_DATABASE_FILE")
+ (string-append (getenv "HOME") "/.config/shroud/db.gpg")))
(gpg-binary . ,%gpg)))
(define (load-config)
"Load and evaluate user configuration file."
- (let ((config (append (load* (string-append (getenv "HOME") "/.shroud")
+ (let ((config (append (load* (or (getenv "SHROUD_CONFIG_FILE")
+ (string-append (getenv "HOME") "/.shroud"))
(make-user-module '((shroud config))))
%default-config)))