[bug#77186,v2,14/14] services: gitolite-service-type: Allow setting the admin name.
Commit Message
* gnu/services/version-control.scm (<gitolite-configuration>): Add admin-name
field.
(gitolite-activation): Use it.
* doc/guix.texi (Version Control Services): Document it. Remove the wrong
default value of admin-pubkey. State the need for .pub extension.
Change-Id: Idadf4b2697cee6d1da10e6ba03bdc2e1d729c417
---
doc/guix.texi | 9 ++++++++-
gnu/services/version-control.scm | 17 +++++++++++------
2 files changed, 19 insertions(+), 7 deletions(-)
@@ -41013,7 +41013,7 @@ Version Control Services
A ``file-like'' object (@pxref{G-Expressions, file-like objects}),
representing the git configuration for Gitolite.
-@item @code{admin-pubkey} (default: @code{#f})
+@item @code{admin-pubkey}
A ``file-like'' object (@pxref{G-Expressions, file-like objects}) used to
setup Gitolite. This will be inserted in to the @file{keydir} directory
within the gitolite-admin repository.
@@ -41024,6 +41024,13 @@ Version Control Services
(plain-file "yourname.pub" "ssh-rsa AAAA... guix@@example.com")
@end lisp
+The file has to have @file{.pub} extension.
+
+@item @code{admin-name} (default: @code{#f})
+Usually the key name is derived by taking a base name of the
+@code{admin-pubkey}. The resulting file name is the name of the
+gitolite user. You can use this field to override the automatic name.
+
@end table
@end deftp
@@ -53,6 +53,7 @@ (define-module (gnu services version-control)
gitolite-configuration-user
gitolite-configuration-rc-file
gitolite-configuration-admin-pubkey
+ gitolite-configuration-admin-name
<gitolite-rc-file>
gitolite-rc-file
@@ -377,7 +378,9 @@ (define-record-type* <gitolite-configuration>
(default (gitolite-rc-file)))
(git-config gitolite-configuration-git-config
(default (gitolite-git-configuration)))
- (admin-pubkey gitolite-configuration-admin-pubkey))
+ (admin-pubkey gitolite-configuration-admin-pubkey)
+ (admin-name gitolite-configuration-admin-name
+ (default #f)))
(define (gitolite-accounts config)
(match-record config <gitolite-configuration>
@@ -396,17 +399,19 @@ (define (gitolite-accounts config)
(define (gitolite-activation config)
(match-record config <gitolite-configuration>
( package user group home-directory rc-file admin-pubkey
- git-config)
+ admin-name git-config)
#~(begin
(use-modules (ice-9 match)
(guix build utils))
(let* ((user-info (getpwnam #$user))
(admin-pubkey #$admin-pubkey)
- (pubkey-file (string-append
- #$home-directory "/"
- (basename
- (strip-store-file-name admin-pubkey))))
+ (pubkey-file (if #$admin-name
+ (string-append #$admin-name ".pub")
+ (string-append
+ #$home-directory "/"
+ (basename
+ (strip-store-file-name admin-pubkey)))))
(rc-file #$(string-append home-directory "/.gitolite.rc")))
;; activate-users+groups in (gnu build activation) sets the