From ee998cf970fc5cfdef2344207db87553d7055bc7 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 14 Sep 2024 20:21:03 +0200 Subject: [PATCH] feat: hydroxide service --- home/home-configuration.scm | 2 ++ .../ruther/home/services/hydroxide.scm | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 home/modules/ruther/home/services/hydroxide.scm diff --git a/home/home-configuration.scm b/home/home-configuration.scm index 1a05707..440f43e 100644 --- a/home/home-configuration.scm +++ b/home/home-configuration.scm @@ -27,6 +27,7 @@ (ruther home dwl wm) (ruther home dwl scripts) (ruther home packages themes) + (ruther home services hydroxide) (ruther home services gtk) (ruther home services xdg-desktop-portals) (ruther home services wayland) @@ -265,6 +266,7 @@ exec ~a ~a" (service home-emacs-service-type (home-emacs-configuration (emacs emacs-pgtk))) + (service hydroxide-service-type) (service home-blueman-applet-service-type) (service home-network-manager-applet-service-type) (service home-gammastep-service-type) diff --git a/home/modules/ruther/home/services/hydroxide.scm b/home/modules/ruther/home/services/hydroxide.scm new file mode 100644 index 0000000..ee74f2e --- /dev/null +++ b/home/modules/ruther/home/services/hydroxide.scm @@ -0,0 +1,32 @@ +(define-module (ruther home services hydroxide) + #:use-module (guix gexp) + #:use-module (gnu packages mail) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (gnu services shepherd) + #:use-module (gnu services configuration) + #:use-module (gnu services)) + +(define-configuration home-hydroxide-configuration + (hydroxide (file-like hydroxide) "Hydroxide package to use.")) + +(define (home-hydroxide-shepherd-services config) + (list + (shepherd-service + (documentation "Run hydroxide serve") + (provision '(hydroxide)) + (start #~(make-forkexec-constructor + (list #$(file-append (home-hydroxide-configuration-hydroxide config) + "/bin/hydroxide") + "serve"))) + (stop #~(make-kill-destructor))))) + +(define-public hydroxide-service-type + (service-type + (name 'home-hydroxide) + (description "Run hydroxide bridge for Protonmail.") + (default-value (home-hydroxide-configuration)) + (extensions + (list + (service-extension home-shepherd-service-type + home-hydroxide-shepherd-services))))) -- 2.48.1