aboutsummaryrefslogtreecommitdiffstats
path: root/shepherd
diff options
context:
space:
mode:
authorGravatar Tom Willemse2022-01-14 00:13:00 -0800
committerGravatar Tom Willemse2022-01-14 00:13:00 -0800
commit5e9c6362e4fc90cab5031e6c6b82bffa8fde6ca6 (patch)
treea6b63d514660a80bced39809de7d3fe9c0d07a3b /shepherd
parent976a2c7c284aadcdba3fd4505a7dea19fe48e7d5 (diff)
downloadnew-dotfiles-5e9c6362e4fc90cab5031e6c6b82bffa8fde6ca6.tar.gz
new-dotfiles-5e9c6362e4fc90cab5031e6c6b82bffa8fde6ca6.zip
Add shepherd configuration with Emacs service
Diffstat (limited to 'shepherd')
-rw-r--r--shepherd/.config/shepherd/init.org13
1 files changed, 13 insertions, 0 deletions
diff --git a/shepherd/.config/shepherd/init.org b/shepherd/.config/shepherd/init.org
new file mode 100644
index 0000000..05c9d6e
--- /dev/null
+++ b/shepherd/.config/shepherd/init.org
@@ -0,0 +1,13 @@
+[[info:shepherd][The Shepherd manual]] suggests that you use a single =init.scm=, but as is pointed out by this article about [[https://guix.gnu.org/en/blog/2020/gnu-shepherd-user-services/][GNU Shepherd user services]] it might be better to have the services in separate files so you can restart them individually if you make any changes to them. So I just put a loading script into =init.scm= that goes through the =init.d= directory and loads each service defined in there.
+
+#+begin_src scheme
+(use-modules (shepherd service)
+ ((ice-9 ftw) #:select (scandir)))
+
+(for-each
+ (λ (file) (load (string-append "init.d/" file)))
+ (scandir (string-append (dirname (current-filename)) "/init.d")
+ (λ (file) (string-suffix? ".scm" file))))
+
+(action 'shepherd 'daemonize)
+#+end_src