aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Ballou <kb@devnulllabs.io>2023-11-29 08:06:05 -0700
committerKenny Ballou <kb@devnulllabs.io>2023-12-04 14:48:36 -0700
commitadc3421c365f1cd407a5c64f272976c4f3f6553b (patch)
tree5d635800b043c873fb8e877f93c845495b2f66c4
parent0ed5bc46d616676fbc25ba040eb908d25ef1718f (diff)
downloaddotfiles-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>
-rw-r--r--config/guix/.gitignore1
-rw-r--r--config/guix/shell-authorized-directories21
-rw-r--r--config/guix/shell-authorized-directories.template4
-rw-r--r--kbg/services/config/guix.scm28
4 files changed, 26 insertions, 28 deletions
diff --git a/config/guix/.gitignore b/config/guix/.gitignore
new file mode 100644
index 00000000..9ec7d669
--- /dev/null
+++ b/config/guix/.gitignore
@@ -0,0 +1 @@
+shell-authorized-directories
diff --git a/config/guix/shell-authorized-directories b/config/guix/shell-authorized-directories
deleted file mode 100644
index b13bda01..00000000
--- a/config/guix/shell-authorized-directories
+++ /dev/null
@@ -1,21 +0,0 @@
-/home/kb/.ledger
-/home/kb/.org
-/home/kb/workspace/src/io/devnulllabs/kb/dotfiles
-/home/kb/workspace/src/io/devnulllabs/kb/guix-channel
-/home/kb/workspace/src/io/devnulllabs/kb/git-in-reverse
-/home/kb/workspace/src/io/devnulllabs/kb/intro-graphs
-/home/kb/workspace/src/io/devnulllabs/kb/intro-static-analysis
-/home/kb/workspace/src/io/devnulllabs/kb/resume
-/home/kb/workspace/src/edu/boisestate/classes/m596
-/home/kb/workspace/src/edu/boisestate/kb
-/home/kb/workspace/src/edu/boisestate/sb
-/home/kb/workspace/src/edu/boisestate/cs/abse
-/home/kb/workspace/src/edu/boisestate/cs/DFA_SMT
-/home/kb/workspace/src/edu/boisestate/cs/sbst-coverage
-/home/kb/workspace/src/edu/boisestate/cs/thqs
-/home/kb/workspace/src/edu/boisestate/cs/thesis-dissertation-template
-/home/kb/workspace/src/edu/unl/cse/paclab-transformer
-/home/kb/workspace/src/gov/nasa/jpf-core
-/home/kb/workspace/src/gov/nasa/jpf-symbc
-/home/kb/workspace/src/org/gnu/guix
-/home/kb/workspace/src/org/evosuite/evosuite
diff --git a/config/guix/shell-authorized-directories.template b/config/guix/shell-authorized-directories.template
new file mode 100644
index 00000000..8955628b
--- /dev/null
+++ b/config/guix/shell-authorized-directories.template
@@ -0,0 +1,4 @@
+/home/kb/.org
+/home/kb/workspace/src/io/devnulllabs/kb/dotfiles
+/home/kb/workspace/src/io/devnulllabs/kb/guix-channel
+/home/kb/workspace/src/org/gnu/guix
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"))
+ )
+ )
+ )
+ )
+ )
+ )