;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Nikita ;;; Copyright © 2016 Sou Bunnbu ;;; Copyright © 2017 Oleg Pykhalov ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2018 Christopher Baines ;;; Copyright © 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu services version-control) #:use-module (gnu services) #:use-module (gnu services base) #:use-module (gnu services shepherd) #:use-module (gnu services web) #:use-module (gnu system shadow) #:use-module (gnu packages version-control) #:use-module (gnu packages admin) #:use-module (guix deprecation) #:use-module (guix records) #:use-module (guix gexp) #:use-module (guix store) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (ice-9 format) #:use-module (ice-9 match) #:export (git-daemon-service git-daemon-service-type git-daemon-configuration git-daemon-configuration? git-http-configuration git-http-configuration? git-http-nginx-location-configuration gitolite-configuration gitolite-configuration-package gitolite-configuration-user gitolite-configuration-rc-file gitolite-configuration-admin-pubkey gitolite-rc-file gitolite-rc-file-local-code gitolite-rc-file-umask gitolite-rc-file-unsafe-pattern gitolite-rc-file-git-config-keys gitolite-rc-file-roles gitolite-rc-file-enable gitolite-service-type gitile-configuration gitile-configuration-package gitile-configuration-host gitile-configuration-port gitile-configuration-database gitile-configuration-repositories gitile-configuration-git-base-url gitile-configuration-index-title gitile-configuration-intro gitile-configuration-footer gitile-configuration-nginx gitile-service-type)) ;;; Commentary: ;;; ;;; Version Control related services. ;;; ;;; Code: ;;; ;;; Git daemon. ;;; (define-record-type* git-daemon-configuration make-git-daemon-configuration git-daemon-configuration? (package git-daemon-configuration-package ;file-like (default git)) (export-all? git-daemon-configuration-export-all ;boolean (default #f)) (base-path git-daemon-configuration-base-path ;string | #f (default "/srv/git")) (user-path git-daemon-configuration-user-path ;string | #f (default #f)) (listen git-daemon-configuration-listen ;list of string (default '())) (port git-daemon-configuration-port ;number | #f (default #f)) (whitelist git-daemon-configuration-whitelist ;list of string (default '())) (extra-options git-daemon-configuration-extra-options ;list of string (default '()))) (define git-daemon-shepherd-service (match-lambda (($ package export-all? base-path user-path listen port whitelist extra-options) (let* ((git (file-append package "/bin/git")) (command `(,git "daemon" "--syslog" "--reuseaddr" ,@(if export-all? '("--export-all") '()) ,@(if base-path `(,(string-append "--base-path=" base-path)) '()) ,@(if user-path `(,(string-append "--user-path=" user-path)) '()) ,@(map (cut string-append "--listen=" <>) listen) ,@(if port `(,(string-append "--port=" (number->string port))) '())