diff options
author | Rodion Goritskov <rodion.goritskov@gmail.com> | 2024-06-07 01:36:59 +0400 |
---|---|---|
committer | Rodion Goritskov <rodion.goritskov@gmail.com> | 2024-06-07 01:36:59 +0400 |
commit | d0a43d850880cda6764fb4e13ed7cc43d1cbe823 (patch) | |
tree | 3ad637ee3b097b0c260c38c7a288415e3751449d /rodion/services | |
parent | bffc0534d22a831f95a6c46ed7dcfd2c38a4d0a5 (diff) | |
parent | 154e3f8149f957fde2986bdaec773b26b8b607fb (diff) |
Merge branch 'master' of ssh://ssh.goritskov.com:10022/rodion/little-guix-channel
Diffstat (limited to 'rodion/services')
-rw-r--r-- | rodion/services/miniflux.scm | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/rodion/services/miniflux.scm b/rodion/services/miniflux.scm index 9ac78cc..4d8bf9f 100644 --- a/rodion/services/miniflux.scm +++ b/rodion/services/miniflux.scm @@ -11,11 +11,11 @@ #:use-module (ice-9 string-fun) #:export (miniflux-service-type miniflux-configuration - miniflux-configuration? - miniflux-configuration-test?)) + miniflux-configuration?)) (define (initial-string? val) (string? val)) (define (initial-boolean? val) (boolean? val)) +(define (strip-initial-prefix field-name) (string-drop (symbol->string field-name) 8)) (define (serialize-string field-name val) (format #f "~a=~a\n" (string-upcase @@ -23,20 +23,15 @@ (if (symbol? field-name) (symbol->string field-name) field-name) "-" "_")) val)) +(define (serialize-boolean field-name val) + (if val (serialize-string field-name "1") (serialize-string field-name "0"))) + +;; Initial string is just a string with 'initial-' prefix (define (serialize-initial-string field-name val) - (serialize-string (string-drop (symbol->string field-name) 8) val)) + (serialize-string (strip-initial-prefix field-name) val)) (define (serialize-initial-boolean field-name val) - (serialize-boolean (string-drop (symbol->string field-name) 8) val)) - -(define (non-negative-integer? val) - (and (exact-integer? val) (not (negative? val)))) - -(define (serialize-non-negative-integer field-name val) - (serialize-string field-name (number->string val))) - -(define (serialize-boolean field-name val) - (if val (serialize-string field-name "1") "")) + (serialize-boolean (strip-initial-prefix field-name) val)) (define-configuration miniflux-configuration (listen-addr |