dev.fron.io rc / e270c7b
system(delta): factorise substitutors out Tony Olagbaiye a month ago
4 changed file(s) with 84 addition(s) and 66 deletion(s). Raw diff Collapse all Expand all
00 (define-module (rc home)
1 #:use-module (rc home leaf)
2 #:export (users
3 homes
4 current-user
5 current-home
6
7 leaf))
1 #:use-module (rc home leaf)
2 #:use-module (srfi srfi-1)
3 #:export (users
4 homes
5 current-user
6 current-home
7
8 leaf))
89
910 (define users
1011 (hash-fold (lambda (k v p) (cons k p))
1213 (module-submodules (current-module))))
1314
1415 (define-public homes
15 (map (lambda (user)
16 (cons (symbol->string user)
17 (module-ref (hashq-ref (module-submodules (current-module)) user) 'env)))
18 users))
16 (filter-map
17 (lambda (user)
18 (if (eq? user 'factors) #f
19 (cons (symbol->string user)
20 (module-ref (hashq-ref (module-submodules (current-module)) user) 'env))))
21 users))
1922
2023 (define (current-user) (getlogin))
2124
44 #:use-module (gnu)
55 #:use-module (gnu system nss)
66 #:use-module (nongnu system linux-initrd)
7 #:use-module (rc system factors guix)
78 #:use-module (gnu services desktop)
89 #:use-module (gnu services sddm)
910 #:use-module (gnu services shepherd)
404405 (service home-service-type
405406 (home-configuration
406407 (user "leaf")))
407 (modify-services
408 %desktop-services
409 (delete gdm-service-type)
410 (delete network-manager-service-type)
411 (delete pulseaudio-service-type)
412 (delete alsa-service-type)
413 (guix-service-type config =>
414 (guix-configuration
415 (inherit config)
416 (substitute-urls
417 (append
418 (list "https://bordeaux.guix.gnu.org"
419 "https://mirror.brielmaier.net")
420 %default-substitute-urls))
421 (authorized-keys
422 (append
423 %default-authorized-guix-keys
424 (list (plain-file
425 "mirror.brielmair.net.pub"
426 (canonical-sexp->string
427 (sexp->canonical-sexp
428 '(public-key
429 (ecc
430 (curve Ed25519)
431 (q #vu8(117 20 248 215 41 219 25 53
432 71 10 88 28 227 133 30 217
433 253 111 31 155 175 225 216 190
434 199 122 147 26 219 122 67 55))))
435 )))
436 (plain-file
437 "bordeaux.guix.gnu.org.pub"
438 (canonical-sexp->string
439 (sexp->canonical-sexp
440 '(public-key
441 (ecc
442 (curve Ed25519)
443 (q #vu8(125 96 41 2 211 162 219 184
444 63 138 15 185 134 2 167 84
445 197 73 59 11 119 140 141 29
446 212 224 244 29 225 77 227 79))))
447 ))))
448 (list))))))))))
408 (fold (lambda (a b) (apply a (list b)))
409 (modify-services
410 %desktop-services
411 (delete gdm-service-type)
412 (delete network-manager-service-type)
413 (delete pulseaudio-service-type)
414 (delete alsa-service-type))
415 (list modify-guix-service))))))
0 (define-module (rc system factors guix)
1 #:use-module (gcrypt pk-crypto)
2 #:use-module (guix gexp)
3 #:use-module (gnu services)
4 #:use-module (gnu services base)
5 #:export (modify-guix-service))
6
7 (define (modify-guix-service services)
8 (modify-services services
9 (guix-service-type config =>
10 (guix-configuration
11 (inherit config)
12 (substitute-urls
13 (append
14 (list "https://bordeaux.guix.gnu.org"
15 "https://mirror.brielmaier.net")
16 %default-substitute-urls))
17 (authorized-keys
18 (append
19 %default-authorized-guix-keys
20 (list (plain-file
21 "mirror.brielmair.net.pub"
22 (canonical-sexp->string
23 (sexp->canonical-sexp
24 '(public-key
25 (ecc
26 (curve Ed25519)
27 (q #vu8(117 20 248 215 41 219 25 53
28 71 10 88 28 227 133 30 217
29 253 111 31 155 175 225 216 190
30 199 122 147 26 219 122 67 55))))
31 )))
32 (plain-file
33 "bordeaux.guix.gnu.org.pub"
34 (canonical-sexp->string
35 (sexp->canonical-sexp
36 '(public-key
37 (ecc
38 (curve Ed25519)
39 (q #vu8(125 96 41 2 211 162 219 184
40 63 138 15 185 134 2 167 84
41 197 73 59 11 119 140 141 29
42 212 224 244 29 225 77 227 79))))
43 ))))
44 (list)))))))
00 (define-module (rc system)
1 #:use-module (rc system delta)
2 #:use-module (rc system epsilon)
3 #:export (hosts
4 systems
5 current-host
6 current-system
7
8 delta
9 epsilon))
1 #:use-module (rc system delta)
2 #:use-module (rc system epsilon)
3 #:use-module (srfi srfi-1)
4 #:export (hosts
5 systems
6 current-host
7 current-system
8
9 delta
10 epsilon))
1011
1112 (define hosts
1213 (hash-fold (lambda (k v p) (cons k p))
1415 (module-submodules (current-module))))
1516
1617 (define-public systems
17 (map (lambda (host)
18 (cons (symbol->string host)
19 (module-ref (hashq-ref (module-submodules (current-module)) host) 'os)))
20 hosts))
18 (filter-map
19 (lambda (host)
20 (if (eq? host 'factors) #f
21 (cons (symbol->string host)
22 (module-ref (hashq-ref (module-submodules (current-module)) host) 'os))))
23 hosts))
2124
2225 (define (current-host) (gethostname))
2326