Rosenthal/rosenthal/services/file-systems.scm
Hilton Chain dd5d17c654
rosenthal: License compliance with REUSE.
$ reuse lint
 # SUMMARY

 * Bad licenses: 0
 * Deprecated licenses: 0
 * Licenses without file extension: 0
 * Missing licenses: 0
 * Unused licenses: 0
 * Used licenses: GPL-3.0-or-later, CC0-1.0
 * Read errors: 0
 * Files with copyright information: 25 / 25
 * Files with license information: 25 / 25

 Congratulations! Your project is compliant with version 3.3 of the REUSE Specification :-)
2025-01-19 15:36:03 +08:00

47 lines
1.3 KiB
Scheme

;; SPDX-FileCopyrightText: 2024 Hilton Chain <hako@ultrarare.space>
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
(define-module (rosenthal services file-systems)
#:use-module (guix gexp)
#:use-module (gnu packages backup)
#:use-module (gnu services)
#:use-module (gnu services configuration)
#:use-module (gnu services mcron)
#:export (btrbk-service-type
btrbk-configuration))
;;
;; Btrbk
;;
(define-configuration btrbk-configuration
(btrbk
(file-like btrbk)
"@code{btrbk} package to use.")
(config-file
(file-like (plain-file "empty" ""))
"File-like object for btrbk configuration, see also @code{btrbk.conf(5)}.")
(no-serialization))
(define (btrbk-etc-service config)
`(("btrbk/btrbk.conf" ,(btrbk-configuration-config-file config))))
(define (btrbk-mcron-jobs config)
(list #~(job next-hour-from
#$(file-append (btrbk-configuration-btrbk config)
"/bin/btrbk run --quiet"))))
(define btrbk-service-type
(service-type
(name 'btrbk)
(extensions
(list (service-extension etc-service-type
btrbk-etc-service)
(service-extension mcron-service-type
btrbk-mcron-jobs)))
(default-value (btrbk-configuration))
(description "Configure and run btrbk hourly.")))