guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Bruno Victal
Subject: [bug#60791] [PATCH] gnu: services: Add joycond-service.
Date: Fri, 13 Jan 2023 22:46:19 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]