mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
services: jellyfin: Use the contract system.
This commit is contained in:
1 file changed
+14
-12
@@ -7,8 +7,10 @@
|
|||||||
#:use-module (guix modules)
|
#:use-module (guix modules)
|
||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix records)
|
#:use-module (guix records)
|
||||||
|
#:use-module (rosenthal utils contract combinators)
|
||||||
#:use-module (rosenthal utils file)
|
#:use-module (rosenthal utils file)
|
||||||
#:use-module (rosenthal utils predicates)
|
#:use-module (rosenthal utils predicates)
|
||||||
|
#:use-module (rosenthal utils records)
|
||||||
;; Guix origin methods
|
;; Guix origin methods
|
||||||
#:use-module (guix download)
|
#:use-module (guix download)
|
||||||
;; Guix System
|
;; Guix System
|
||||||
@@ -392,7 +394,7 @@ test its configuration file."))
|
|||||||
;;; Jellyfin media system (Native, currently written for the Nix package).
|
;;; Jellyfin media system (Native, currently written for the Nix package).
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define-record-type* <jellyfin-configuration>
|
(define-record-type/dolly <jellyfin-configuration>
|
||||||
jellyfin-configuration
|
jellyfin-configuration
|
||||||
make-jellyfin-configuration
|
make-jellyfin-configuration
|
||||||
jellyfin-configuration?
|
jellyfin-configuration?
|
||||||
@@ -462,9 +464,9 @@ test its configuration file."))
|
|||||||
(documentation
|
(documentation
|
||||||
"Extra command-line options.")))
|
"Extra command-line options.")))
|
||||||
|
|
||||||
(define (jellyfin-account-service config)
|
(define jellyfin-account-service
|
||||||
(match-record config <jellyfin-configuration>
|
(match-record-lambda/dolly <jellyfin-configuration>
|
||||||
(data-directory user group)
|
(data-directory user group)
|
||||||
(list (user-group
|
(list (user-group
|
||||||
(name "jellyfin")
|
(name "jellyfin")
|
||||||
(id group)
|
(id group)
|
||||||
@@ -478,9 +480,9 @@ test its configuration file."))
|
|||||||
(shell (file-append shadow "/sbin/nologin"))
|
(shell (file-append shadow "/sbin/nologin"))
|
||||||
(system? #t)))))
|
(system? #t)))))
|
||||||
|
|
||||||
(define (jellyfin-activation-service config)
|
(define jellyfin-activation-service
|
||||||
(match-record config <jellyfin-configuration>
|
(match-record-lambda/dolly <jellyfin-configuration>
|
||||||
(data-directory config-directory cache-directory log-directory)
|
(data-directory config-directory cache-directory log-directory)
|
||||||
#~(let ((owner (getpwnam "jellyfin")))
|
#~(let ((owner (getpwnam "jellyfin")))
|
||||||
(for-each (lambda (dir)
|
(for-each (lambda (dir)
|
||||||
(mkdir-p/perms dir owner #o755))
|
(mkdir-p/perms dir owner #o755))
|
||||||
@@ -489,11 +491,11 @@ test its configuration file."))
|
|||||||
cache-directory
|
cache-directory
|
||||||
log-directory)))))
|
log-directory)))))
|
||||||
|
|
||||||
(define (jellyfin-shepherd-service config)
|
(define jellyfin-shepherd-service
|
||||||
(match-record config <jellyfin-configuration>
|
(match-record-lambda/dolly <jellyfin-configuration>
|
||||||
(jellyfin
|
(jellyfin
|
||||||
data-directory config-directory cache-directory log-directory
|
data-directory config-directory cache-directory log-directory
|
||||||
shepherd-requirement extra-options)
|
shepherd-requirement extra-options)
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(documentation "Run the Jellyfin media system.")
|
(documentation "Run the Jellyfin media system.")
|
||||||
(provision '(jellyfin))
|
(provision '(jellyfin))
|
||||||
|
|||||||
Reference in new issue
Block a user