aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-03-01 18:46:28 +0100
committerOscar Najera <hi@oscarnajera.com>2023-03-03 11:54:47 +0100
commit3f0c451eb4f3571133c2c0f3a208de79b632de97 (patch)
tree6407c1f554824ae17631c99fa0ce9f47d3e1703d
parent3e24c14dde0e8f83447a087cf6cf6bba4957a1a4 (diff)
downloaddotfiles-3f0c451eb4f3571133c2c0f3a208de79b632de97.tar.gz
dotfiles-3f0c451eb4f3571133c2c0f3a208de79b632de97.tar.bz2
dotfiles-3f0c451eb4f3571133c2c0f3a208de79b632de97.zip
habit tracker service daemon
-rw-r--r--config/shepherd/init.d/my-daemons.scm15
-rw-r--r--config/shepherd/init.scm2
2 files changed, 16 insertions, 1 deletions
diff --git a/config/shepherd/init.d/my-daemons.scm b/config/shepherd/init.d/my-daemons.scm
new file mode 100644
index 0000000..85de6d2
--- /dev/null
+++ b/config/shepherd/init.d/my-daemons.scm
@@ -0,0 +1,15 @@
+
+(register-services
+ (make <service>
+ #:docstring "Habit tracker"
+ #:provides '(habit-logs)
+ #:start (make-forkexec-constructor
+ (list "sbcl" "--load"
+ (string-append (getenv "HOME") "/.sbclrc")
+ "--load"
+ (string-append (getenv "HOME") "/dev/common-lisp/todo-demo/habit.lisp")
+ "--eval" "(habit-log::main)" "--non-interactive")
+ #:directory (string-append (getenv "HOME") "/dev/common-lisp/todo-demo/")
+ #:log-file "/tmp/habits.log")
+ #:stop (make-kill-destructor 2) ;; 2 is SIGINT - interupt process stream, ctrl-C
+ #:respawn? #t))
diff --git a/config/shepherd/init.scm b/config/shepherd/init.scm
index 7b548e9..d7f31b1 100644
--- a/config/shepherd/init.scm
+++ b/config/shepherd/init.scm
@@ -22,4 +22,4 @@
;; Services to start when shepherd starts:
;; Add the name of each service that should be started to the list
;; below passed to 'for-each'.
-(for-each start '())
+(for-each start '(habit-logs))