GNU bug report logs -
#60791
[PATCH] gnu: services: Add joycond-service.
Previous Next
Full log
Message #8 received at 60791 <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 2 years and 185 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.