summaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-03-25 20:06:24 +0000
committerChristopher Baines <mail@cbaines.net>2024-03-25 20:40:22 +0000
commitb538c1d7b95587d3f111a7bb610747e93c5f2468 (patch)
treeb5fc922ae6603b8e79084b7efc038b40f182e462 /gnu/services
parent9b399add9861bd608c6344313a090eadaec0fa55 (diff)
services: nar-herder: Add new configuration options.
* gnu/services/guix.scm (nar-herder-configuration-new-ttl, nar-herder-cached-compression-configuration-unused-removal-duration, nar-herder-cached-compression-configuration-ttl, nar-herder-cached-compression-configuration-new-ttl): New procedure. (nar-herder-shepherd-services): Handle the new options. * doc/guix.texi (Guix Services): Document the new nar-herder options. Change-Id: I161e490221a3ce394e32ada685dca27df60638bb
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/guix.scm40
1 files changed, 37 insertions, 3 deletions
diff --git a/gnu/services/guix.scm b/gnu/services/guix.scm
index c438da531c..8b326d9124 100644
--- a/gnu/services/guix.scm
+++ b/gnu/services/guix.scm
@@ -719,6 +719,8 @@ ca-certificates.crt file in the system profile."
(default '()))
(ttl nar-herder-configuration-ttl
(default #f))
+ (new-ttl nar-herder-configuration-new-ttl
+ (default #f))
(negative-ttl nar-herder-configuration-negative-ttl
(default #f))
(log-level nar-herder-configuration-log-level
@@ -750,14 +752,22 @@ ca-certificates.crt file in the system profile."
(default #f))
(directory-max-size
nar-herder-cached-compression-configuration-directory-max-size
- (default #f)))
+ (default #f))
+ (unused-removal-duration
+ nar-herder-cached-compression-configuration-unused-removal-duration
+ (default #f))
+ (ttl nar-herder-cached-compression-configuration-ttl
+ (default #f))
+ (new-ttl nar-herder-cached-compression-configuration-new-ttl
+ (default #f)))
(define (nar-herder-shepherd-services config)
(define (cached-compression-configuration->options cached-compression)
(match-record
cached-compression
<nar-herder-cached-compression-configuration>
- (type level directory directory-max-size)
+ (type level directory directory-max-size
+ unused-removal-duration ttl new-ttl)
`(,(simple-format #f "--enable-cached-compression=~A~A"
type
@@ -775,6 +785,27 @@ ca-certificates.crt file in the system profile."
(simple-format #f "--cached-compression-directory-max-size=~A=~A"
type
directory-max-size))
+ '())
+ ,@(if unused-removal-duration
+ (list
+ (simple-format
+ #f "--cached-compression-unused-removal-duration=~A=~A"
+ type
+ unused-removal-duration))
+ '())
+ ,@(if ttl
+ (list
+ (simple-format
+ #f "--cached-compression-ttl=~A=~A"
+ type
+ ttl))
+ '())
+ ,@(if new-ttl
+ (list
+ (simple-format
+ #f "--cached-compression-new-ttl=~A=~A"
+ type
+ new-ttl))
'()))))
(match-record config <nar-herder-configuration>
@@ -783,7 +814,7 @@ ca-certificates.crt file in the system profile."
database database-dump
host port
storage storage-limit storage-nar-removal-criteria
- ttl negative-ttl log-level
+ ttl new-ttl negative-ttl log-level
cached-compressions cached-compression-min-uses
cached-compression-workers cached-compression-nar-source
extra-environment-variables)
@@ -825,6 +856,9 @@ ca-certificates.crt file in the system profile."
#$@(if ttl
(list (string-append "--ttl=" ttl))
'())
+ #$@(if new-ttl
+ (list (string-append "--new-ttl=" new-ttl))
+ '())
#$@(if negative-ttl
(list (string-append "--negative-ttl=" negative-ttl))
'())