mirror of https://codeberg.org/hako/Rosenthal.git
* rosenthal/services/file-systems.scm: New file. (<btrbk-configuration>): New data type. (btrbk-etc-service,btrbk-mcron-jobs): New procedures. (btrbk-service-type): New variable.trunk
parent
06eb07b022
commit
c202ed2037
1 changed files with 42 additions and 0 deletions
@ -0,0 +1,42 @@ |
|||||||
|
(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."))) |
Loading…
Reference in new issue