Skip to content
Snippets Groups Projects
Unverified Commit f4596f76 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

services: guix: Add 'log-compression' option.

* gnu/services/base.scm (<guix-configuration>)[log-compression]: New
field.
(guix-shepherd-service): Use 'match-record' instead of 'match'.  Honor
'log-compression'.
* doc/guix.texi (Base Services): Document 'log-compression'.
parent 767d24e8
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
(eval . (put 'guard 'scheme-indent-function 1)) (eval . (put 'guard 'scheme-indent-function 1))
(eval . (put 'lambda* 'scheme-indent-function 1)) (eval . (put 'lambda* 'scheme-indent-function 1))
(eval . (put 'substitute* 'scheme-indent-function 1)) (eval . (put 'substitute* 'scheme-indent-function 1))
(eval . (put 'match-record 'scheme-indent-function 2))
;; 'modify-phases' and its keywords. ;; 'modify-phases' and its keywords.
(eval . (put 'modify-phases 'scheme-indent-function 1)) (eval . (put 'modify-phases 'scheme-indent-function 1))
......
...@@ -9929,6 +9929,10 @@ The number of seconds of silence and the number of seconds of activity, ...@@ -9929,6 +9929,10 @@ The number of seconds of silence and the number of seconds of activity,
respectively, after which a build process times out. A value of zero respectively, after which a build process times out. A value of zero
disables the timeout. disables the timeout.
   
@item @code{log-compression} (default: @code{'bzip2})
The type of compression used for build logs---one of @code{gzip},
@code{bzip2}, or @code{none}.
@item @code{extra-options} (default: @code{'()}) @item @code{extra-options} (default: @code{'()})
List of extra command-line options for @command{guix-daemon}. List of extra command-line options for @command{guix-daemon}.
   
......
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com> ;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
...@@ -1438,6 +1438,8 @@ (define-record-type* <guix-configuration> ...@@ -1438,6 +1438,8 @@ (define-record-type* <guix-configuration>
(default 0)) (default 0))
(timeout guix-configuration-timeout ;integer (timeout guix-configuration-timeout ;integer
(default 0)) (default 0))
(log-compression guix-configuration-log-compression
(default 'bzip2))
(extra-options guix-configuration-extra-options ;list of strings (extra-options guix-configuration-extra-options ;list of strings
(default '())) (default '()))
(log-file guix-configuration-log-file ;string (log-file guix-configuration-log-file ;string
...@@ -1452,39 +1454,37 @@ (define %default-guix-configuration ...@@ -1452,39 +1454,37 @@ (define %default-guix-configuration
(define (guix-shepherd-service config) (define (guix-shepherd-service config)
"Return a <shepherd-service> for the Guix daemon service with CONFIG." "Return a <shepherd-service> for the Guix daemon service with CONFIG."
(match config (match-record config <guix-configuration>
(($ <guix-configuration> guix build-group build-accounts (guix build-group build-accounts authorize-key? authorized-keys
authorize-key? keys use-substitutes? substitute-urls max-silent-time timeout
use-substitutes? substitute-urls log-compression extra-options log-file http-proxy tmpdir)
max-silent-time timeout (list (shepherd-service
extra-options (documentation "Run the Guix daemon.")
log-file http-proxy tmpdir) (provision '(guix-daemon))
(list (shepherd-service (requirement '(user-processes))
(documentation "Run the Guix daemon.") (start
(provision '(guix-daemon)) #~(make-forkexec-constructor
(requirement '(user-processes)) (list #$(file-append guix "/bin/guix-daemon")
(start "--build-users-group" #$build-group
#~(make-forkexec-constructor "--max-silent-time" #$(number->string max-silent-time)
(list #$(file-append guix "/bin/guix-daemon") "--timeout" #$(number->string timeout)
"--build-users-group" #$build-group "--log-compression" #$(symbol->string log-compression)
"--max-silent-time" #$(number->string max-silent-time) #$@(if use-substitutes?
"--timeout" #$(number->string timeout) '()
#$@(if use-substitutes? '("--no-substitutes"))
'() "--substitute-urls" #$(string-join substitute-urls)
'("--no-substitutes")) #$@extra-options)
"--substitute-urls" #$(string-join substitute-urls)
#$@extra-options) #:environment-variables
(list #$@(if http-proxy
#:environment-variables (list (string-append "http_proxy=" http-proxy))
(list #$@(if http-proxy '())
(list (string-append "http_proxy=" http-proxy)) #$@(if tmpdir
'()) (list (string-append "TMPDIR=" tmpdir))
#$@(if tmpdir '()))
(list (string-append "TMPDIR=" tmpdir))
'())) #:log-file #$log-file))
(stop #~(make-kill-destructor))))))
#:log-file #$log-file))
(stop #~(make-kill-destructor)))))))
(define (guix-accounts config) (define (guix-accounts config)
"Return the user accounts and user groups for CONFIG." "Return the user accounts and user groups for CONFIG."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment