blob: 8e46d8b6cb99334ff16f04a013d11e94ec63a885 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
(define-module (directories)
:use-module (util)
:use-module (util config)
)
;; TODO possiblyy create a (system) parameter, which flips many
;; settings between being based in $HOME, and in / (or $prefix/).
(define-config path-prefix "/usr")
(define-public runtime-directory
(or (getenv "XDG_RUNTIME_DIR")
"/tmp"))
(define-public system-config-directory "/etc/calp")
(define-public user-config-directory
(path-append
(or (getenv "XDG_CONFIG_HOME")
(and=> (getenv "HOME")
(lambda (s) (path-append s "/.config"))))
"/calp"))
(define (libexec%)
(or (getenv "LIBEXEC")
(path-append (get-config 'path-prefix)
"/lib/calp")))
(define-syntax libexec (identifier-syntax (libexec%)))
(export libexec)
(define (data-directory%)
(path-append
(or (getenv "XDG_DATA_HOME")
(path-append (get-config 'path-prefix) "/share"))
"/calp"))
(define-syntax data-directory (identifier-syntax (data-directory%)))
(export data-directory)
|