| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | (define-module (gnu home services guix)
|
| 21 | #:use-module (gnu home services)
|
| 22 | #:use-module (guix channels)
|
| 23 | #:use-module (guix gexp)
|
| 24 | #:use-module (ice-9 pretty-print)
|
| 25 | #:use-module (srfi srfi-1)
|
| 26 | #:export (home-channels-service-type))
|
| 27 |
|
| 28 | (define (extend-channel-list initial new)
|
| 29 | (delete-duplicates
|
| 30 | (append initial new)
|
| 31 | (lambda (channel1 channel2)
|
| 32 | (eq? (channel-name channel1) (channel-name channel2)))))
|
| 33 |
|
| 34 | (define (channels-xdg-files channels)
|
| 35 | `(("guix/channels.scm"
|
| 36 | ,(plain-file
|
| 37 | "channels.scm"
|
| 38 | (call-with-output-string
|
| 39 | (lambda (port)
|
| 40 | (pretty-print (cons 'list (map channel->code channels)) port)))))))
|
| 41 |
|
| 42 | (define home-channels-service-type
|
| 43 | (service-type
|
| 44 | (name 'home-channels)
|
| 45 | (default-value %default-channels)
|
| 46 | (compose concatenate)
|
| 47 | (extend extend-channel-list)
|
| 48 | (extensions
|
| 49 | (list (service-extension home-xdg-configuration-files-service-type
|
| 50 | channels-xdg-files)))
|
| 51 | (description "Manages the per-user Guix channels specification.")))
|