Subject: [bug#60791] [PATCH] gnu: services: Add joycond-service.

From: Bruno Victal <[email-masked]>
Date: Fri, 13 Jan 2023 22:46:19 +0000

Hi,

--8<---------------cut here---------------start------------->8---
+@defvar {Scheme Variable} joycond-service-type
+Service type for the joycond service.
+@end defvar
--8<---------------cut here---------------end--------------->8---

Should be `@defvar joycond-service-type'.

--8<---------------cut here---------------start------------->8---
+(define-record-type* <joycond-configuration>
+  joycond-configuration make-joycond-configuration
+  joycond-configuration?
+  (joycond joycond-configuration-joycond (default joycond)))
--8<---------------cut here---------------end--------------->8---

This could be replaced with define-configuration/no-serialization since
the only field here is a package / file-like object. (see [1], [2] for examples)
I'd prefer the field be called 'package' here. 

--8<---------------cut here---------------start------------->8---
+(define (joycond-shepherd-service config)
+  (let ((joycond (joycond-configuration-joycond config)))
+    (list (shepherd-service
+           (documentation "Run joycond.")
+           (provision '(joycond))
+           (requirement '(bluetooth))
+           (start #~(make-forkexec-constructor
+                     (list #$(file-append joycond "/bin/joycond"))))
+           (stop #~(make-kill-destructor))))))
--8<---------------cut here---------------end--------------->8---

You might prefer match-record here but this is okay as well.

[1]: https://issues.guix.gnu.org/60788
[2]: ddclient-configuration in gnu/services/dns.scm

Cheers,
Bruno