Compare commits

...

2 Commits

Author SHA1 Message Date
Hilton Chain
b46e9132f3
services: Add komga-service-type.
* rosenthal/services/web.scm (<komga-configuration>): New data type.
(%komga-accounts,komga-shepherd-service,komga-service-type): New variables.
* README.org (Services): Add komga-service-type.
2025-01-23 23:33:13 +08:00
Hilton Chain
18758a8415
rosenthal: Add komga-bin.
* rosenthal/packages/binaries.scm (komga-bin): New package.
* README.org (Packages): Add it.
* etc/manifest: Add it.
2025-01-23 23:33:12 +08:00
4 changed files with 114 additions and 0 deletions

View File

@ -97,6 +97,7 @@ Binary Packages / 二進制包:
+ atuin-bin
+ clash-bin
+ hugo-bin
+ komga-bin
+ mihomo-bin
+ miniflux-injector-icecat
+ shadow-tls-bin
@ -116,6 +117,7 @@ Nonfree Software / 非自由軟件:
+ iwd-service-type
+ forgejo-service-type
+ jellyfin-service-type
+ komga-service-type
+ miniflux-service-type
+ misskey-service-type
+ qbittorrent-service-type

View File

@ -10,6 +10,7 @@
"cloudflared"
"dinit"
"hugo-bin"
"komga-bin"
"mihomo-bin"
"shadow-tls-bin"
"sing-box-bin"

View File

@ -10,11 +10,13 @@
#:use-module (guix build-system copy)
#:use-module (gnu build icecat-extension)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bootstrap)
#:use-module (gnu packages compression)
#:use-module (gnu packages elf)
#:use-module (gnu packages gcc)
#:use-module (gnu packages glib)
#:use-module (gnu packages java)
#:use-module (gnu packages nss))
(define license
@ -245,6 +247,53 @@ designed for flexibility.")
(license license:asl2.0)
(properties '((upstream-name . "hugo")))))
(define-public komga-bin
(package
(name "komga-bin")
(version "1.18.0")
(source (origin
(method url-fetch)
(uri (string-append
"https://github.com/gotson/komga/releases/download/" version
"/komga-" version ".jar"))
(sha256
(base32
"1rjjyv2fdb8hqc46az5gw2jgza1p8kg0db98iv4cmmhzgmyljk13"))))
(build-system copy-build-system)
(arguments
(list #:install-plan
#~'((#$(string-append "komga-" (package-version this-package) ".jar")
"lib/komga/komga.jar"))
#:phases
#~(modify-phases %standard-phases
(replace 'install
(lambda* (#:key inputs source #:allow-other-keys)
(let* ((lib (in-vicinity #$output "lib/komga"))
(bin (in-vicinity #$output "bin"))
(jar (in-vicinity lib "komga.jar"))
(exe "komga"))
(mkdir-p lib)
(copy-file source jar)
(call-with-output-file exe
(lambda (port)
(format port "~
#!~a
export LC_ALL=C.UTF-8
exec ~a -jar ~a $@~%"
(search-input-file inputs "bin/bash")
(search-input-file inputs "bin/java")
jar)))
(chmod exe #o555)
(install-file exe bin)))))))
(inputs (list bash-minimal openjdk))
(home-page "https://komga.org/")
(synopsis "Media server for comics/mangas/BDs/magazines/eBooks")
(description
"Komga is a media server for your comics, mangas, BDs, magazines and
eBooks.")
(license license:expat)
(properties '((upstream-name . "komga")))))
(define miniflux-injector
(package
(name "miniflux-injector")

View File

@ -7,6 +7,7 @@
#:use-module (guix records)
#:use-module (gnu packages admin)
#:use-module (gnu packages version-control)
#:use-module (rosenthal packages binaries)
#:use-module (rosenthal packages web)
#:use-module (gnu services)
#:use-module (gnu services admin)
@ -22,6 +23,9 @@
jellyfin-configuration
jellyfin-service-type
komga-configuration
komga-service-type
misskey-configuration
misskey-service-type
@ -206,6 +210,64 @@
(default-value (jellyfin-configuration))
(description "Run Jellyfin, a media system.")))
;;;
;;; Komga
;;;
(define-configuration komga-configuration
(komga
(file-like komga-bin)
"Package to provide @file{/bin/komga}.")
(port
(integer 25600)
"Port to listen to for the API and web interface.")
(auto-start?
(boolean #t)
"Whether to start automatically.")
(no-serialization))
(define %komga-accounts
(list (user-group (name "komga") (system? #t))
(user-account
(name "komga")
(group "komga")
(system? #t)
(comment "Komga user")
(home-directory "/var/lib/komga"))))
(define komga-shepherd-service
(match-record-lambda <komga-configuration>
(komga port auto-start?)
(list (shepherd-service
(documentation "Run Komga.")
(provision '(komga))
(requirement '(loopback))
(start
#~(make-forkexec-constructor
(list #$(file-append komga "/bin/komga"))
#:user "komga"
#:group "komga"
#:log-file "/var/log/komga.log"
#:environment-variables
'("KOMGA_CONFIGDIR=/var/lib/komga"
#$(string-append "SERVER_PORT=" (number->string port)))))
(stop
#~(make-kill-destructor))
(auto-start? auto-start?)))))
(define komga-service-type
(service-type
(name 'komga)
(extensions
(list (service-extension account-service-type
(const %komga-accounts))
(service-extension shepherd-root-service-type
komga-shepherd-service)))
(default-value (komga-configuration))
(description "Run Komga.")))
;;
;; Misskey