summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-04-25 08:18:38 +0100
committerChristopher Baines <mail@cbaines.net>2018-05-18 17:24:39 +0100
commit6ee3f3dec72f87187226bc11ff190f030169e55a (patch)
tree8668011e1bde39c8028356b49bf71ec15ac41e3c /gnu/services
parentc3343d62f682b33b1eefce74e9b08585faa8680c (diff)
downloadguix-6ee3f3dec72f87187226bc11ff190f030169e55a.tar.gz
services: cgit: Make project-list permit a file-object.
Instead of having the service manage the list, it's useful to be able to point
this at an existing file, for example, when using cgit together with gitolite.

* gnu/services/cgit.scm (project-list?): New procedure.
(serialize-project-list): Handle file-object values.
(<cgit-configuration>): Change the predicate for project-list to allow lists
and file-objects.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/cgit.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm
index 3183535d4a..3289d37333 100644
--- a/gnu/services/cgit.scm
+++ b/gnu/services/cgit.scm
@@ -116,6 +116,10 @@
 (define (serialize-file-object field-name val)
   (serialize-string field-name val))
 
+(define (project-list? val)
+  (or (list? val)
+      (file-object? val)))
+
 
 ;;;
 ;;; Serialize <nginx-server-configuration>
@@ -168,7 +172,9 @@
   (if (null? val) ""
       (serialize-field
        'project-list
-       (plain-file "project-list" (string-join val "\n")))))
+       (if (file-object? val)
+           val
+           (plain-file "project-list" (string-join val "\n"))))))
 
 (define (serialize-extra-options extra-options)
   (string-join extra-options "\n" 'suffix))
@@ -547,7 +553,7 @@ disabled.")
    "Flag which, when set to @samp{#t}, will make cgit omit the standard
 header on all pages.")
   (project-list
-   (list '())
+   (project-list '())
    "A list of subdirectories inside of @code{repository-directory}, relative
 to it, that should loaded as Git repositories.  An empty list means that all
 subdirectories will be loaded.")