services: qbittorrent: Use match-record.

* rosenthal/services/bittorrent.scm (qbittorrent-shepherd-service): Use
match-record.
pull/1/head
Hilton Chain 1 year ago
parent 45061dd211
commit 5ae5900f2d
No known key found for this signature in database
GPG Key ID: ACC66D09CA528292
  1. 37
      rosenthal/services/bittorrent.scm

@ -3,9 +3,9 @@
;; SPDX-License-Identifier: GPL-3.0-or-later ;; SPDX-License-Identifier: GPL-3.0-or-later
(define-module (rosenthal services bittorrent) (define-module (rosenthal services bittorrent)
#:use-module (ice-9 match)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix records)
#:use-module (gnu packages admin) #:use-module (gnu packages admin)
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services configuration) #:use-module (gnu services configuration)
@ -55,24 +55,23 @@
(mkdir-p profile-directory) (mkdir-p profile-directory)
(chown profile-directory (passwd:uid user) (passwd:gid user))))) (chown profile-directory (passwd:uid user) (passwd:gid user)))))
(define qbittorrent-shepherd-service (define (qbittorrent-shepherd-service config)
(match-lambda (match-record config <qbittorrent-configuration>
(($ <qbittorrent-configuration> qbittorrent (qbittorrent log-file webui-port profile-directory extra-options)
log-file webui-port profile-directory (list (shepherd-service
extra-options) (documentation "Run qbittorrent.")
(list (shepherd-service (provision '(qbittorrent))
(documentation "Run qbittorrent.") (requirement '(loopback))
(provision '(qbittorrent)) (start #~(make-forkexec-constructor
(requirement '(loopback)) (list #$(file-append qbittorrent "/bin/qbittorrent-nox")
(start #~(make-forkexec-constructor #$(string-append "--webui-port="
(list #$(file-append qbittorrent "/bin/qbittorrent-nox") (number->string webui-port))
#$(string-append "--webui-port=" (number->string webui-port)) #$(string-append "--profile=" profile-directory)
#$(string-append "--profile=" profile-directory) #$@extra-options)
#$@extra-options) #:user "qbittorrent"
#:user "qbittorrent" #:group "qbittorrent"
#:group "qbittorrent" #:log-file #$log-file))
#:log-file #$log-file)) (stop #~(make-kill-destructor #:grace-period 1800))))))
(stop #~(make-kill-destructor #:grace-period 1800)))))))
(define qbittorrent-service-type (define qbittorrent-service-type
(service-type (service-type

Loading…
Cancel
Save