diff --git a/doc/guix.texi b/doc/guix.texi index 4bdbe4b70..d5abf900a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17000,8 +17000,10 @@ Extra options will be passed to @code{git daemon}, please run @end table @end deftp -@subsubheading Cgit service +@subsubheading Cgit Service +@cindex Cgit service +@cindex Git, web interface @uref{https://git.zx2c4.com/cgit/, Cgit} is a web frontend for Git repositories written in C. diff --git a/gnu/services/version-control.scm b/gnu/services/version-control.scm index 50b09c0ce..208351447 100644 --- a/gnu/services/version-control.scm +++ b/gnu/services/version-control.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 ng0 ;;; Copyright © 2016 Sou Bunnbu +;;; Copyright © 2017 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -189,18 +190,23 @@ access to exported repositories under @file{/srv/git}." (match file (($ css logo robots virtual-root repository-directory) - (text-file - "cgitrc" - (string-concatenate - (filter-map - (match-lambda - ((key . #f) #f) - ((key . value) (string-append key "=" value "\n"))) - `(("css" . ,css) - ("logo" . ,logo) - ("robots" . ,(cgit-configuration-robots-string robots)) - ("virtual-root" . ,virtual-root) - ("repository-directory" . ,repository-directory)))))))) + (apply text-file* "cgitrc" + (letrec-syntax ((option (syntax-rules () + ((_ key value) + (if value + `(,key "=" ,value) + '())))) + (key/value (syntax-rules () + ((_ (key value) rest ...) + (append (option key value) + (key/value rest ...))) + ((_) + '())))) + (key/value ("css" css) + ("logo" logo) + ("robots" (cgit-configuration-robots-string robots)) + ("virtual-root" virtual-root) + ("repository-directory" repository-directory))))))) (define %cgit-configuration-nginx (list