diff options
author | Kenny Ballou <kb@devnulllabs.io> | 2023-11-29 08:06:05 -0700 |
---|---|---|
committer | Kenny Ballou <kb@devnulllabs.io> | 2023-12-04 14:48:36 -0700 |
commit | adc3421c365f1cd407a5c64f272976c4f3f6553b (patch) | |
tree | 5d635800b043c873fb8e877f93c845495b2f66c4 /kbg | |
parent | 0ed5bc46d616676fbc25ba040eb908d25ef1718f (diff) | |
download | dotfiles-adc3421c365f1cd407a5c64f272976c4f3f6553b.tar.gz dotfiles-adc3421c365f1cd407a5c64f272976c4f3f6553b.tar.xz |
config: guix: shell auth: install template unless file exists
Install a basic template for `shell-authorized-directories`. If a
"real" version exists (which will not be checked in anymore),
concatenate it into the template.
While this is not private in the sense that the computed file is still
in the store, it does serve a purpose of not having to commit the whole
file every time.
Signed-off-by: Kenny Ballou <kb@devnulllabs.io>
Diffstat (limited to 'kbg')
-rw-r--r-- | kbg/services/config/guix.scm | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/kbg/services/config/guix.scm b/kbg/services/config/guix.scm index a89f0755..a63377b6 100644 --- a/kbg/services/config/guix.scm +++ b/kbg/services/config/guix.scm @@ -2,12 +2,26 @@ #:use-module (kbg) #:use-module (gnu) #:use-module (guix) - #:use-module (gnu home services)) + #:use-module (gnu home services) + #:use-module (ice-9 textual-ports)) (define-public guix-config-service - (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" - ,(local-file (string-append %dotfiles-root "config/guix/shell-authorized-directories"))))))) + (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")) + ) + ) + ) + ) + ) + ) |