aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-03-10 16:20:44 +0530
committerArun Isaac2022-03-10 16:20:44 +0530
commit8875ac474926e59826ea3ddb0c7c07d9a38dfdaf (patch)
tree6498f6121f87f81d72a89f6e37edd47cc8245442
parent024abc8c0856f5f39c4051f807a63ffc50f8e1fe (diff)
downloadguix-bioinformatics-8875ac474926e59826ea3ddb0c7c07d9a38dfdaf.tar.gz
services: databases: Prefer (guix records) to define-configuration.
define-configuration does too much magic. * gn/services/databases.scm (<virtuoso-configuration>): Redefine using (guix records). Export virtuoso-configuration?. (virtuoso-shepherd-service): Represent a disabled port with #f.
-rw-r--r--gn/services/databases.scm25
1 files changed, 10 insertions, 15 deletions
diff --git a/gn/services/databases.scm b/gn/services/databases.scm
index 7d0d1f0..2a995d7 100644
--- a/gn/services/databases.scm
+++ b/gn/services/databases.scm
@@ -5,7 +5,9 @@
#:use-module (gnu services configuration)
#:use-module (gnu services shepherd)
#:use-module (guix packages)
+ #:use-module (guix records)
#:export (virtuoso-configuration
+ virtuoso-configuration?
virtuoso-configuration-package
virtuoso-configuration-http-server-port
virtuoso-service-type))
@@ -14,19 +16,13 @@
;;; Virtuoso
;;;
-(define-maybe non-negative-integer)
-
-(define (non-negative-integer? val)
- (and (integer? val)
- (not (negative? val))))
-
-(define-configuration virtuoso-configuration
- (package
- (package virtuoso-ose)
- "The virtuoso package.")
- (http-server-port
- (maybe-non-negative-integer 'disabled)
- "The port on which to listen for HTTP connections."))
+(define-record-type* <virtuoso-configuration>
+ virtuoso-configuration make-virtuoso-configuration
+ virtuoso-configuration?
+ (package virtuoso-configuration-package
+ (default virtuoso-ose))
+ (http-server-port virtuoso-configuration-http-server-port
+ (default 8890)))
(define %virtuoso-accounts
(list (user-group (name "virtuoso")
@@ -53,8 +49,7 @@
"virtuoso.ini"
#~(call-with-output-file #$output
(lambda (port)
- (when (not (eq? #$(virtuoso-configuration-http-server-port config)
- 'disabled))
+ (when #$(virtuoso-configuration-http-server-port config)
(format port "[HTTPServer]~%")
(format port "ServerPort = ~a~%"
#$(virtuoso-configuration-http-server-port config)))))))