aboutsummaryrefslogtreecommitdiff
path: 2020-08-12gnu: r-ps: Update to 1.3.4....Ricardo Wurmus 2020-08-12gnu: r-pls: Update to 2.7-3....Ricardo Wurmus 2020-08-12gnu: r-servr: Update to 0.18....Ricardo Wurmus 2020-08-12gnu: r-rvest: Update to 0.3.6....Ricardo Wurmus 2020-08-12gnu: r-sys: Update to 3.4....Ricardo Wurmus 2020-08-12gnu: r-seurat: Update to 3.2.0....Ricardo Wurmus 2020-08-12gnu: r-nmf: Update to 0.23.0....Ricardo Wurmus 2020-08-12gnu: Add r-cpp11....Ricardo Wurmus 2020-08-12gnu: Add r-gaston....Ricardo Wurmus 2020-08-12gnu: Add r-spatstat....Ricardo Wurmus 2020-08-12gnu: Add r-spatstat-data....Ricardo Wurmus 2020-08-12gnu: Add r-spatstat-utils....Ricardo Wurmus 2020-08-12gnu: Add r-tensor....Ricardo Wurmus 2020-08-12gnu: Add r-goftest....Ricardo Wurmus 2020-08-12gnu: terminology: Update to 1.8.1....Efraim Flashner 2020-08-12gnu: nano: Update to 5.1....Tobias Geerinckx-Rice 2020-08-12gnu: emacs-buttercup: Update to 1.23....Oleg Pykhalov 2020-08-11gnu: Add linux-libre-arm64-generic at version 5.4....Vagrant Cascadian 2020-08-11gnu: emacs-treepy: Update to 0.1.2....Michael Rohleder 2020-08-11gnu: uhttpmock: Update to 0.5.3....Tobias Geerinckx-Rice 2020-08-11gnu: uhttpmock: Download over HTTPS....Tobias Geerinckx-Rice 2020-08-11gnu: linux-libre: Update to 5.7.15....Mark H Weaver 2020-08-11gnu: linux-libre@5.8: Update to 5.8.1....Mark H Weaver 2020-08-11gnu: linux-libre@5.4: Update to 5.4.58....Mark H Weaver 2020-08-11gnu: linux-libre@4.19: Update to 4.19.139....Mark H Weaver 2020-08-12gnu: emacs-lsp-mode: Update to 7.0.1....Oleg Pykhalov 2020-08-11gnu: emacs-nix-mode: Update to 1.4.4....Oleg Pykhalov 2020-08-11gnu: links: Update to 2.21....Tobias Geerinckx-Rice 2020-08-11gnu: waybar: Update to 0.9.3....Tobias Geerinckx-Rice 2020-08-11gnu: sxhkd: Update to 0.6.2....Tobias Geerinckx-Rice 2020-08-11gnu: tumbler: Update to 0.2.9....Tobias Geerinckx-Rice 2020-08-11gnu: gnome-boxes: Update to 3.36.6....Tobias Geerinckx-Rice 2020-08-11gnu: goffice: Update to 0.10.47....Tobias Geerinckx-Rice
(system? #t) (comment "Gitolite user") (home-directory home-directory)))))) (define gitolite-activation (match-lambda (($ <gitolite-configuration> package user group home rc-file admin-pubkey) #~(begin (use-modules (ice-9 match) (guix build utils)) (let* ((user-info (getpwnam #$user)) (admin-pubkey #$admin-pubkey) (pubkey-file (string-append #$home "/" (basename (strip-store-file-name admin-pubkey)))) (rc-file #$(string-append home "/.gitolite.rc"))) ;; activate-users+groups in (gnu build activation) sets the ;; permission flags of home directories to #o700 and mentions that ;; services needing looser permissions should chmod it during ;; service activation. We also want the git group to be able to ;; read from the gitolite home directory, so a chmod'ing we will ;; go! (chmod #$home #o750) (simple-format #t "guix: gitolite: installing ~A\n" #$rc-file) (copy-file #$rc-file rc-file) ;; ensure gitolite's user can read the configuration (chown rc-file (passwd:uid user-info) (passwd:gid user-info)) ;; The key must be writable, so copy it from the store (copy-file admin-pubkey pubkey-file) (chmod pubkey-file #o500) (chown pubkey-file (passwd:uid user-info) (passwd:gid user-info)) ;; 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 "/.gitconfig") (lambda () (display "[user] name = GNU Guix email = guix@localhost "))) ;; 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 ;; initial setup (match (primitive-fork) (0 ;; Exit with a non-zero status code if an exception is thrown. (dynamic-wind (const #t) (lambda () (setenv "HOME" (passwd:dir user-info)) (setenv "USER" #$user) (setgid (passwd:gid user-info)) (setuid (passwd:uid user-info)) (primitive-exit (system* #$(file-append package "/bin/gitolite") "setup" "-m" "gitolite setup by GNU Guix" "-pk" pubkey-file))) (lambda () (primitive-exit 1)))) (pid (waitpid pid))) (when (file-exists? pubkey-file) (delete-file pubkey-file))))))) (define gitolite-service-type (service-type (name 'gitolite) (extensions (list (service-extension activation-service-type gitolite-activation) (service-extension account-service-type gitolite-accounts) (service-extension profile-service-type ;; The Gitolite package in Guix uses ;; gitolite-shell in the authorized_keys file, so ;; gitolite-shell needs to be on the PATH for ;; gitolite to work. (lambda (config) (list (gitolite-configuration-package config)))))) (description "Set up @command{gitolite}, a Git hosting tool providing access over SSH. By default, the @code{git} user is used, but this is configurable. Additionally, Gitolite can integrate with with tools like gitweb or cgit to provide a web interface to view selected repositories."))) ;;; ;;; Gitile ;;; (define-record-type* <gitile-configuration> gitile-configuration make-gitile-configuration gitile-configuration? (package gitile-configuration-package (default gitile)) (host gitile-configuration-host (default "127.0.0.1")) (port gitile-configuration-port (default 8080)) (database gitile-configuration-database (default "/var/lib/gitile/gitile-db.sql")) (repositories gitile-configuration-repositories (default "/var/lib/gitolite/repositories")) (base-git-url gitile-configuration-base-git-url) (index-title gitile-configuration-index-title (default "Index")) (intro gitile-configuration-intro (default '())) (footer gitile-configuration-footer (default '())) (nginx gitile-configuration-nginx)) (define (gitile-config-file host port database repositories base-git-url index-title intro footer) (define build #~(write `(config (port #$port) (host #$host) (database #$database) (repositories #$repositories) (base-git-url #$base-git-url) (index-title #$index-title) (intro #$intro) (footer #$footer)) (open-output-file #$output))) (computed-file "gitile.conf" build)) (define gitile-nginx-server-block (match-lambda (($ <gitile-configuration> package host port database repositories base-git-url index-title intro footer nginx) (list (nginx-server-configuration (inherit nginx) (locations (append (list (nginx-location-configuration (uri "/") (body (list #~(string-append "proxy_pass http://" #$host ":" (number->string #$port) "/;"))))) (map (lambda (loc) (nginx-location-configuration (uri loc) (body (list #~(string-append "root " #$package "/share/gitile/assets;"))))) '("/css" "/js" "/images")) (nginx-server-configuration-locations nginx)))))))) (define gitile-shepherd-service (match-lambda (($ <gitile-configuration> package host port database repositories base-git-url index-title intro footer nginx) (list (shepherd-service (provision '(gitile)) (requirement '(loopback)) (documentation "gitile") (start (let ((gitile (file-append package "/bin/gitile"))) #~(make-forkexec-constructor `(,#$gitile "-c" #$(gitile-config-file host port database repositories base-git-url index-title intro footer)) #:user "gitile" #:group "git"))) (stop #~(make-kill-destructor))))))) (define %gitile-accounts (list (user-group (name "git") (system? #t)) (user-account (name "gitile") (group "git") (system? #t) (comment "Gitile user") (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) (define gitile-service-type (service-type (name 'gitile) (description "Run Gitile, a small Git forge. Expose public repositories on the web.") (extensions (list (service-extension account-service-type (const %gitile-accounts)) (service-extension shepherd-root-service-type gitile-shepherd-service) (service-extension nginx-service-type gitile-nginx-server-block)))))