aboutsummaryrefslogtreecommitdiff
path: root/kbg/services/config/guix.scm
blob: a63377b6263d8230b85cf7b7849098bd09397ec5 (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
(define-module (kbg services config guix)
  #:use-module (kbg)
  #:use-module (gnu)
  #:use-module (guix)
  #:use-module (gnu home services)
  #:use-module (ice-9 textual-ports))

(define-public guix-config-service
  (let ((shell-auth-dirs (string-append %dotfiles-root "config/guix/shell-authorized-directories"))
        (shell-auth-dirs-template (string-append %dotfiles-root "config/guix/shell-authorized-directories.template")))
    (list (simple-service 'guix-config
                          home-files-service-type
                          `((".config/guix/channels.scm"
                             ,(local-file (string-append %dotfiles-root "config/guix/channels.scm")))
                            (".config/guix/shell-authorized-directories"
                             ,(plain-file "kb-shell-authorized-directories"
                                          (string-join (list (call-with-input-file shell-auth-dirs-template get-string-all)
                                                             (if (file-exists? shell-auth-dirs)
                                                                 (call-with-input-file shell-auth-dirs get-string-all)
                                                                 ""))
                                                       "\n"))
                             )
                            )
                          )
          )
    )
  )