-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.scm
79 lines (59 loc) · 2.18 KB
/
config.scm
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
(define-module (config)
;#:use-module (config workhorse)
;#:use-module (config geekcave)
#:use-module (config elftower)
#:use-module (ice-9 match)
#:use-module (rde features))
;; (define* (use-nested-configuration-modules
;; #:key
;; (users-subdirectory "/config/features")
;; (hosts-subdirectory "/config/packages"))
;; (use-modules (guix discovery)
;; (guix modules))
;; (define current-module-file
;; (search-path %load-path
;; (module-name->file-name (module-name (current-module)))))
;; (define current-module-directory
;; (dirname (and=> current-module-file canonicalize-path)))
;; (define src-directory
;; (dirname current-module-directory))
;; (define current-module-subdirectory
;; (string-drop current-module-directory (1+ (string-length src-directory))))
;; (define users-modules
;; (scheme-modules
;; src-directory
;; (string-append current-module-subdirectory users-subdirectory)))
;; (define hosts-modules
;; (scheme-modules
;; src-directory
;; (string-append current-module-subdirectory hosts-subdirectory)))
;; (map (lambda (x) (module-use! (current-module) x)) hosts-modules)
;; (map (lambda (x) (module-use! (current-module) x)) users-modules))
;; (use-nested-configuration-modules)
;; (define geekcave-os
;; (rde-config-operating-system geekcave-config))
;; (define geekcave-he
;; (rde-config-home-environment geekcave-config))
;; (define workhorse-os
;; (rde-config-operating-system workhorse-config))
;; (define workhorse-he
;; (rde-config-home-environment workhorse-config))
(define elftower-os
(rde-config-operating-system elftower-config))
(define elftower-he
(rde-config-home-environment elftower-config))
(define (dispatcher)
(let ((target (getenv "TARGET")))
(match target
("workhorse-he" workhorse-he)
("workhorse-os" workhorse-os)
("elftower-he" elftower-he)
("elftower-os" elftower-os)
("geekcave-he" geekcave-he)
("geekcave-os" geekcave-os)
)))
;;; Enable this to print the entire config object
;;; to see what's enable for example
;; (pretty-print-rde-config geekcave-config)
(dispatcher)
;;elftower-he