services: cuirass: Put specifications in the store.

* gnu/services/cuirass.scm (<cuirass-configuration>): Change type of
'specifications' field to an alist to match the documentation example.
(cuirass-shepherd-service): Store the provided specifications in a file.  Use
that file as the "--specification" argument.
This commit is contained in:
Mathieu Lirzin 2016-12-01 20:41:08 +01:00
parent 44ccd9622e
commit 57aa94bd7e
No known key found for this signature in database
GPG Key ID: 0ADEE10094604D37
1 changed files with 7 additions and 5 deletions

View File

@ -52,8 +52,8 @@
(default 60)) (default 60))
(database cuirass-configuration-database ;string (file-name) (database cuirass-configuration-database ;string (file-name)
(default "/var/run/cuirass/cuirass.db")) (default "/var/run/cuirass/cuirass.db"))
(specifications cuirass-configuration-specifications ;string (file-name) (specifications cuirass-configuration-specifications ;specification-alist
(default "")) (default '()))
(use-substitutes? cuirass-configuration-use-substitutes? ;boolean (use-substitutes? cuirass-configuration-use-substitutes? ;boolean
(default #f)) (default #f))
(one-shot? cuirass-configuration-one-shot? ;boolean (one-shot? cuirass-configuration-one-shot? ;boolean
@ -66,7 +66,7 @@
(let ((cache-directory (cuirass-configuration-cache-directory config)) (let ((cache-directory (cuirass-configuration-cache-directory config))
(interval (cuirass-configuration-interval config)) (interval (cuirass-configuration-interval config))
(database (cuirass-configuration-database config)) (database (cuirass-configuration-database config))
(specifications (cuirass-configuration-specifications config)) (specs (cuirass-configuration-specifications config))
(use-substitutes? (cuirass-configuration-use-substitutes? config)) (use-substitutes? (cuirass-configuration-use-substitutes? config))
(one-shot? (cuirass-configuration-one-shot? config))) (one-shot? (cuirass-configuration-one-shot? config)))
(list (shepherd-service (list (shepherd-service
@ -78,9 +78,11 @@
#$@(if (string=? "" cache-directory) #$@(if (string=? "" cache-directory)
'() '()
(list "--cache-directory" cache-directory)) (list "--cache-directory" cache-directory))
#$@(if (string=? "" specifications) #$@(if (null? specs)
'() '()
(list "--specifications" specifications)) (let ((str (format #f "'~S" specs)))
(list "--specifications"
(plain-file "specs.scm" str))))
"--database" #$database "--database" #$database
"--interval" #$(number->string interval) "--interval" #$(number->string interval)
#$@(if use-substitutes? '("--use-substitutes") '()) #$@(if use-substitutes? '("--use-substitutes") '())