mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-31 06:46:50 +01:00
services: fstrim-service-type: Serialize with SRFI-171 transducers.
* gnu/services/linux.scm (serialize-fstrim-configuration): Refactor to use base-transducer. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
a7994ed58d
commit
dd65564db0
1 changed files with 4 additions and 7 deletions
|
@ -41,6 +41,7 @@ (define-module (gnu services linux)
|
|||
#:use-module (srfi srfi-26)
|
||||
#:use-module (srfi srfi-34)
|
||||
#:use-module (srfi srfi-35)
|
||||
#:use-module (srfi srfi-171)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (ice-9 match)
|
||||
#:export (earlyoom-configuration
|
||||
|
@ -252,13 +253,9 @@ (define-configuration fstrim-configuration
|
|||
(prefix fstrim-))
|
||||
|
||||
(define (serialize-fstrim-configuration config)
|
||||
(concatenate
|
||||
(filter list?
|
||||
(map (lambda (field)
|
||||
((configuration-field-serializer field)
|
||||
(configuration-field-name field)
|
||||
((configuration-field-getter field) config)))
|
||||
fstrim-configuration-fields))))
|
||||
(list-transduce (compose (base-transducer config) tconcatenate)
|
||||
rcons
|
||||
fstrim-configuration-fields))
|
||||
|
||||
(define (fstrim-mcron-job config)
|
||||
(match-record config <fstrim-configuration> (package schedule)
|
||||
|
|
Loading…
Reference in a new issue