diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2014-07-14 15:51:22 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2014-07-14 15:51:22 +0200 |
| commit | c11a6eb1e5064271c21306de2f4633d83e224320 (patch) | |
| tree | 190a1d6210f4984525a5b1031c24e5f8a7d13211 /gnu | |
| parent | 55e70e655dfc70ff8c30bcd7161b717f5d9b6a57 (diff) | |
services: Add options to 'guix-service'.
* gnu/services/base.scm (guix-service): Add #:use-substitutes? and
#:extra-options parameters, and honor them.
* doc/guix.texi (Base Services): Adjust accordingly.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/services/base.scm | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index eb7c9dce042..acda08d19a7 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm | |||
| @@ -368,13 +368,22 @@ GUIX." | |||
| 368 | failed to register hydra.gnu.org public key: ~a~%" status)))))))) | 368 | failed to register hydra.gnu.org public key: ~a~%" status)))))))) |
| 369 | 369 | ||
| 370 | (define* (guix-service #:key (guix guix) (builder-group "guixbuild") | 370 | (define* (guix-service #:key (guix guix) (builder-group "guixbuild") |
| 371 | (build-accounts 10) authorize-hydra-key?) | 371 | (build-accounts 10) authorize-hydra-key? |
| 372 | (use-substitutes? #t) | ||
| 373 | (extra-options '())) | ||
| 372 | "Return a service that runs the build daemon from @var{guix}, and has | 374 | "Return a service that runs the build daemon from @var{guix}, and has |
| 373 | @var{build-accounts} user accounts available under @var{builder-group}. | 375 | @var{build-accounts} user accounts available under @var{builder-group}. |
| 374 | 376 | ||
| 375 | When @var{authorize-hydra-key?} is true, the @code{hydra.gnu.org} public key | 377 | When @var{authorize-hydra-key?} is true, the @code{hydra.gnu.org} public key |
| 376 | provided by @var{guix} is authorized upon activation, meaning that substitutes | 378 | provided by @var{guix} is authorized upon activation, meaning that substitutes |
| 377 | from @code{hydra.gnu.org} are used by default." | 379 | from @code{hydra.gnu.org} are used by default. |
| 380 | |||
| 381 | If @var{use-substitutes?} is false, the daemon is run with | ||
| 382 | @option{--no-substitutes} (@pxref{Invoking guix-daemon, | ||
| 383 | @option{--no-substitutes}}). | ||
| 384 | |||
| 385 | Finally, @var{extra-options} is a list of additional command-line options | ||
| 386 | passed to @command{guix-daemon}." | ||
| 378 | (define activate | 387 | (define activate |
| 379 | ;; Assume that the store has BUILDER-GROUP as its group. We could | 388 | ;; Assume that the store has BUILDER-GROUP as its group. We could |
| 380 | ;; otherwise call 'chown' here, but the problem is that on a COW unionfs, | 389 | ;; otherwise call 'chown' here, but the problem is that on a COW unionfs, |
| @@ -392,7 +401,11 @@ from @code{hydra.gnu.org} are used by default." | |||
| 392 | (start | 401 | (start |
| 393 | #~(make-forkexec-constructor | 402 | #~(make-forkexec-constructor |
| 394 | (list (string-append #$guix "/bin/guix-daemon") | 403 | (list (string-append #$guix "/bin/guix-daemon") |
| 395 | "--build-users-group" #$builder-group))) | 404 | "--build-users-group" #$builder-group |
| 405 | #$@(if use-substitutes? | ||
| 406 | '() | ||
| 407 | '("--no-substitutes")) | ||
| 408 | #$@extra-options))) | ||
| 396 | (stop #~(make-kill-destructor)) | 409 | (stop #~(make-kill-destructor)) |
| 397 | (user-accounts accounts) | 410 | (user-accounts accounts) |
| 398 | (user-groups (list (user-group | 411 | (user-groups (list (user-group |
