mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
services: Add gitolite-git-configuration.
In preparation for further customizability of the git configuration, extract the current setup into a separate record type. * gnu/services/version-control.scm (<gitolite-git-configuration>): New record type. (gitolite-git-configuration-compiler): And gexp compiler for it. (<gitolite-configuration>): Add git-config field. (gitolite-activation): Use it. * doc/guix.texi (Version Control Services): Document both. Change-Id: I7658698a93f938f62f41a4fa45b72de1eeb14414 Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
This commit is contained in:
parent
9ab0c42d55
commit
a0ce5501ca
2 changed files with 47 additions and 7 deletions
|
@ -41006,6 +41006,10 @@ Directory in which to store the Gitolite configuration and repositories.
|
|||
A ``file-like'' object (@pxref{G-Expressions, file-like objects}),
|
||||
representing the configuration for Gitolite.
|
||||
|
||||
@item @code{git-config} (default: @code{(gitolite-git-configuration)})
|
||||
A ``file-like'' object (@pxref{G-Expressions, file-like objects}),
|
||||
representing the git configuration for Gitolite.
|
||||
|
||||
@item @code{admin-pubkey} (default: @code{#f})
|
||||
A ``file-like'' object (@pxref{G-Expressions, file-like objects}) used to
|
||||
setup Gitolite. This will be inserted in to the @file{keydir} directory
|
||||
|
@ -41081,6 +41085,19 @@ Extra content to add verbatim into the @code{%RC} hash.
|
|||
@end table
|
||||
@end deftp
|
||||
|
||||
@deftp {Data Type} gitolite-git-configuration
|
||||
Data type representing the git configuration file for gitolite.
|
||||
|
||||
@table @asis
|
||||
@item @code{name} (default: @code{"GNU GNU"})
|
||||
User name used for commits (e.g. during setting up the admin
|
||||
repository).
|
||||
|
||||
@item @code{email} (default: @code{"guix@@localhost"})
|
||||
Email used for commits (e.g. during setting up the admin repository).
|
||||
|
||||
@end table
|
||||
@end deftp
|
||||
|
||||
@subsubheading Gitile Service
|
||||
|
||||
|
|
|
@ -67,6 +67,12 @@
|
|||
gitolite-rc-file-extra-content
|
||||
gitolite-rc-file-default-enable
|
||||
|
||||
<gitolite-git-configuration>
|
||||
gitolite-git-configuration
|
||||
gitolite-git-configuration?
|
||||
gitolite-git-configuration-name
|
||||
gitolite-git-configuration-email
|
||||
|
||||
gitolite-service-type
|
||||
|
||||
gitile-configuration
|
||||
|
@ -321,6 +327,23 @@ access to exported repositories under @file{/srv/git}."
|
|||
"# End:\n"
|
||||
"# vim: set syn=perl:\n"))))
|
||||
|
||||
(define-record-type* <gitolite-git-configuration>
|
||||
gitolite-git-configuration make-gitolite-git-configuration
|
||||
gitolite-git-configuration?
|
||||
(name gitolite-git-configuration-name
|
||||
(default "GNU Guix"))
|
||||
(email gitolite-git-configuration-email
|
||||
(default "guix@localhost")))
|
||||
|
||||
(define-gexp-compiler (gitolite-git-configuration-compiler
|
||||
(config <gitolite-git-configuration>) system target)
|
||||
(match-record config <gitolite-git-configuration>
|
||||
(name email)
|
||||
(apply text-file* "gitconfig"
|
||||
`("[user]\n"
|
||||
"name = " ,name "\n"
|
||||
"email = " ,email "\n"))))
|
||||
|
||||
(define-record-type* <gitolite-configuration>
|
||||
gitolite-configuration make-gitolite-configuration
|
||||
gitolite-configuration?
|
||||
|
@ -334,6 +357,8 @@ access to exported repositories under @file{/srv/git}."
|
|||
(default "/var/lib/gitolite"))
|
||||
(rc-file gitolite-configuration-rc-file
|
||||
(default (gitolite-rc-file)))
|
||||
(git-config gitolite-configuration-git-config
|
||||
(default (gitolite-git-configuration)))
|
||||
(admin-pubkey gitolite-configuration-admin-pubkey))
|
||||
|
||||
(define (gitolite-accounts config)
|
||||
|
@ -352,7 +377,8 @@ access to exported repositories under @file{/srv/git}."
|
|||
|
||||
(define (gitolite-activation config)
|
||||
(match-record config <gitolite-configuration>
|
||||
(package user group home-directory rc-file admin-pubkey)
|
||||
( package user group home-directory rc-file admin-pubkey
|
||||
git-config)
|
||||
#~(begin
|
||||
(use-modules (ice-9 match)
|
||||
(guix build utils))
|
||||
|
@ -390,12 +416,9 @@ access to exported repositories under @file{/srv/git}."
|
|||
|
||||
;; Set the git configuration, to avoid gitolite trying to use
|
||||
;; the hostname command, as the network might not be up yet
|
||||
(with-output-to-file #$(string-append home-directory "/.gitconfig")
|
||||
(lambda ()
|
||||
(display "[user]
|
||||
name = GNU Guix
|
||||
email = guix@localhost
|
||||
")))
|
||||
(copy-file #$git-config
|
||||
#$(string-append home-directory "/.gitconfig"))
|
||||
|
||||
;; Run Gitolite setup, as this updates the hooks and include the
|
||||
;; admin pubkey if specified. The admin pubkey is required for
|
||||
;; initial setup, and will replace the previous key if run after
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue