services: Add miniflux-service-type.

* rosenthal/services/child-error.scm (miniflux-configuration)
(%miniflux-accounts,%miniflux-postgresql-role,miniflux-shepherd-service)
(miniflux-service-type): New variables.
remotes/origin/cloudflared-unbundle
Hilton Chain 2 years ago
parent f1d89d66f0
commit 4c0227fb4a
No known key found for this signature in database
GPG Key ID: 5E5AA665614917F7
  1. 69
      rosenthal/services/child-error.scm

@ -11,6 +11,7 @@
#: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)
#:use-module (gnu services databases)
#:use-module (gnu services shepherd) #:use-module (gnu services shepherd)
#:use-module (gnu system shadow) #:use-module (gnu system shadow)
#:use-module (rosenthal utils home-services-utils) #:use-module (rosenthal utils home-services-utils)
@ -20,6 +21,9 @@
cloudflare-tunnel-configuration cloudflare-tunnel-configuration
cloudflare-tunnel-service-type cloudflare-tunnel-service-type
miniflux-configuration
miniflux-service-type
home-wakapi-configuration home-wakapi-configuration
home-wakapi-service-type)) home-wakapi-service-type))
@ -192,6 +196,71 @@ headers. This can expose sensitive information in your logs.")
(default-value (cloudflare-tunnel-configuration)) (default-value (cloudflare-tunnel-configuration))
(description "Run cloudflared, the Cloudflare Tunnel daemon."))) (description "Run cloudflared, the Cloudflare Tunnel daemon.")))
;;
;; Miniflux
;;
(define-configuration/no-serialization miniflux-configuration
(miniflux
(string "/bin/miniflux")
"The miniflux executable.")
(log-file
(string "/var/log/miniflux.log")
"Where the logs go.")
(config
(alist '())
"Association list of miniflux configurations."))
(define %miniflux-accounts
(list (user-group (name "miniflux") (system? #t))
(user-account
(name "miniflux")
(group "miniflux")
(system? #t)
(home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin")))))
(define %miniflux-postgresql-role
(list (postgresql-role
(name "miniflux")
(create-database? #t))))
(define miniflux-shepherd-service
(match-lambda
(($ <miniflux-configuration> miniflux log-file config)
(let ((config-file
(mixed-text-file
"miniflux.conf"
(apply string-append
(map (lambda (alist)
(string-append (car alist) "=" (cdr alist) "\n"))
config)))))
(list (shepherd-service
(documentation "Run miniflux.")
(provision '(miniflux))
(requirement '(postgres user-processes))
(start #~(make-forkexec-constructor
(list #$miniflux "-config-file" #$config-file)
#:user "miniflux"
#:group "miniflux"
#:log-file #$log-file))
(stop #~(make-kill-destructor))))))))
(define miniflux-service-type
(service-type
(name 'miniflux)
(extensions
(list (service-extension account-service-type
(const %miniflux-accounts))
(service-extension postgresql-role-service-type
(const %miniflux-postgresql-role))
(service-extension shepherd-root-service-type
miniflux-shepherd-service)))
(default-value (miniflux-configuration))
(description
"Run Miniflux, a minimalist and opinionated feed reader.")))
;; ;;
;; Wakapi ;; Wakapi

Loading…
Cancel
Save