aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/messaging.scm
blob: 7e2056c3473e02849db4b3dffe6baa8de82e9868 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages messaging)
  #:use-module ((guix licenses)
                #:select (gpl2+ gpl2 lgpl2.1 bsd-2))
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnutls)
  #:use-module (gnu packages python)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages check))

(define-public libotr
  (package
    (name "libotr")
    (version "4.0.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://otr.cypherpunks.ca/libotr-"
                                  version ".tar.gz"))
              (sha256
               (base32 "1d4k0b7v4d3scwm858cmqr9c6xgd6ppla1vk4x2yg64q82a1k49z"))))
    (build-system gnu-build-system)
    (propagated-inputs
     `(("libgcrypt" ,libgcrypt)))  ; libotr headers include gcrypt.h
    (inputs `(("libgpg-error" ,libgpg-error)))
    (arguments
     `(#:configure-flags '("--with-pic")))
    (synopsis "Off-the-Record (OTR) Messaging Library and Toolkit")
    (description
     "OTR allows you to have private conversations over instant messaging by
providing:
* Encryption: No one else can read your instant messages.
* Authentication: You are assured the correspondent is who you think it is.
* Deniability: The messages you send do not have digital signatures that are
  checkable by a third party.  Anyone can forge messages after a conversation
  to make them look like they came from you.  However, during a conversation,
  your correspondent is assured the messages he sees are authentic and
  unmodified.
* Perfect forward secrecy: If you lose control of your private keys, no
  previous conversation is compromised.")
    (home-page "https://otr.cypherpunks.ca/")
    (license (list lgpl2.1 gpl2))))

(define-public libotr-3
  (package (inherit libotr)
    (version "3.2.1")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://otr.cypherpunks.ca/libotr-"
                                  version ".tar.gz"))
              (sha256
               (base32 "1x6dd4rh499hdraiqfhz81igrj0a5rs0gjhc8l4sljwqhjjyla6l"))))))

(define-public bitlbee
  (package
    (name "bitlbee")
    (version "3.2.2")
    (source (origin
              (method url-fetch)
              (uri (string-append "http://get.bitlbee.org/src/bitlbee-"
                                  version ".tar.gz"))
              (sha256
               (base32 "13jmcxxgli82wb2n4hs091159xk8rgh7nb02f478lgpjh6996f5s"))))
    (build-system gnu-build-system)
    (native-inputs `(("pkg-config" ,pkg-config)
                     ("check" ,check)))
    (inputs `(("glib" ,glib)
              ("libotr" ,libotr)
              ("gnutls" ,gnutls)
              ("zlib" ,zlib)  ; Needed to satisfy "pkg-config --exists gnutls"
              ("python" ,python-2)
              ("perl" ,perl)))
    (arguments
     `(#:phases (alist-cons-after
                 'install 'install-etc
                 (lambda* (#:key (make-flags '()) #:allow-other-keys)
                   (zero? (apply system* "make" "install-etc" make-flags)))
                 (alist-replace
                  'configure
                  ;; bitlbee's configure script does not tolerate many of the
                  ;; variable settings that Guix would pass to it.
                  (lambda* (#:key outputs #:allow-other-keys)
                    (zero? (system* "./configure"
                                    (string-append "--prefix="
                                                   (assoc-ref outputs "out"))
                                    "--otr=1")))
                  %standard-phases))))
    (synopsis "IRC to instant messaging gateway")
    (description "BitlBee brings IM (instant messaging) to IRC clients, for
people who have an IRC client running all the time and don't want to run an
additional IM client.  BitlBee currently supports XMPP/Jabber (including
Google Talk), MSN Messenger, Yahoo!  Messenger, AIM and ICQ, and the Twitter
microblogging network (plus all other Twitter API compatible services like
identi.ca and status.net).")
    (home-page "http://www.bitlbee.org/")
    (license (list gpl2+ bsd-2))))

;;; messaging.scm ends here
-75,7 +93,8 @@ load MODULES." marionette)) (test-end) (exit (= (test-runner-fail-count (test-runner-current)) 0))))) - (gexp->derivation "loadable-kernel-modules" (test (module-loader-program os module-names)))) + (gexp->derivation "loadable-kernel-modules" + (test (modules-loaded?-program os module-names)))) (define %test-loadable-kernel-modules-0 (system-test -- cgit v1.2.3 From 2729cb406d9f3e9eb22cc660f887138134edb3a8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 5 Apr 2020 23:37:33 +0200 Subject: system: Allow for comma-separated keyboard layouts. Reported by Florian Pelz . * gnu/bootloader/grub.scm (keyboard-layout-file): Replace commas with hyphens in the first argument to 'computed-file'. * gnu/system/keyboard.scm (keyboard-layout->console-keymap): Likewise. * doc/guix.texi (Keyboard Layout): Add example. --- doc/guix.texi | 3 +++ gnu/bootloader/grub.scm | 6 +++++- gnu/system/keyboard.scm | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index bc5602474e..67cedaec1b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11916,6 +11916,9 @@ about. Here are a few example: ;; The Catalan layout. (keyboard-layout "es" "cat") +;; Arabic layout with "Alt-Shift" to switch to US layout. +(keyboard-layout "ar,us" #:options '("grp:alt_shift_toggle")) + ;; The Latin American Spanish layout. In addition, the ;; "Caps Lock" key is used as an additional "Ctrl" key, ;; and the "Menu" key is used as a "Compose" key to enter diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm index 28e6cb1f5f..190b717163 100644 --- a/gnu/bootloader/grub.scm +++ b/gnu/bootloader/grub.scm @@ -240,7 +240,11 @@ the 'share/X11/xkb/symbols/' directory of 'xkeyboard-config'." "-i" #+(keyboard-layout->console-keymap layout) "-o" #$output)))) - (computed-file (string-append "grub-keymap." (keyboard-layout-name layout)) + (computed-file (string-append "grub-keymap." + (string-map (match-lambda + (#\, #\-) + (chr chr)) + (keyboard-layout-name layout))) builder)) (define (grub-setup-io config) diff --git a/gnu/system/keyboard.scm b/gnu/system/keyboard.scm index cd3ab37b27..5bd13a44be 100644 --- a/gnu/system/keyboard.scm +++ b/gnu/system/keyboard.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -94,5 +94,8 @@ Layout information is taken from the XKEYBOARD-CONFIG package." #$(keyboard-layout-name layout)))))) (computed-file (string-append "console-keymap." - (keyboard-layout-name layout)) + (string-map (match-lambda + (#\, #\-) + (chr chr)) + (keyboard-layout-name layout))) build)) -- cgit v1.2.3 From f00f52a1fb5ac08f8059dffcd60d36adcda06603 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 6 Apr 2020 08:35:02 +0200 Subject: gnu: mumi: Update to 0.0.0-12.bb2fe92. * gnu/packages/mail.scm (mumi): Update to 0.0.0-12.bb2fe92. [inputs]: Add guile-gcrypt, guile-redis, guile-webutils, mailutils. * gnu/services/web.scm (): New record type. (mumi-configuration, mumi-configuration?, mumi-configuration-mumi, mumi-configuration-mailer?, mumi-configuration-sender, mumi-configuration-smtp): New procedures. (mumi-shepherd-services): Accept configuration; adjust start commands; add Shepherd service for mumi mailer. (mumi-service-type): Pass default configuration. * doc/guix.texi (Web Services): Update documentation. --- doc/guix.texi | 24 +++++++++++++++++ gnu/packages/mail.scm | 10 ++++--- gnu/services/web.scm | 75 +++++++++++++++++++++++++++++++++++++-------------- 3 files changed, 86 insertions(+), 23 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 67cedaec1b..12094e0feb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -20686,6 +20686,30 @@ but it also fetches and indexes mail retrieved from Debbugs. This is the service type for Mumi. @end defvr +@deftp {Data Type} mumi-configuration +Data type representing the Mumi service configuration. This type has the +following fields: + +@table @asis +@item @code{mumi} (default: @code{mumi}) +The Mumi package to use. + +@item @code{mailer?} (default: @code{#true}) +Whether to enable or disable the mailer component. + +@item @code{mumi-configuration-sender} +The email address used as the sender for comments. + +@item @code{mumi-configuration-smtp} +A URI to configure the SMTP settings for Mailutils. This could be +something like @code{sendmail:///path/to/bin/msmtp} or any other URI +supported by Mailutils. @xref{SMTP Mailboxes, SMTP Mailboxes,, +mailutils, GNU@tie{}Mailutils}. + +@end table +@end deftp + + @subsubheading FastCGI @cindex fastcgi @cindex fcgiwrap diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 2d0e25655f..a4dab88fb2 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -3003,8 +3003,8 @@ replacement for the @code{urlview} program.") (license gpl2+))) (define-public mumi - (let ((commit "0e9af8d11246eb08152a9bcbc3d04703963b756c") - (revision "11")) + (let ((commit "bb2fe926b496dc44f783430ab16f5219bae36e81") + (revision "12")) (package (name "mumi") (version (git-version "0.0.0" revision commit)) @@ -3016,7 +3016,7 @@ replacement for the @code{urlview} program.") (file-name (git-file-name name version)) (sha256 (base32 - "0q5x33gc8gi8w7cjphdmhdyfa62b89mcbmj068yd5jxqx8sn4hlw")))) + "0azqrnkcwnh903f3ap8injhld3jicxdjzbbdi56ax46gjahr1rw3")))) (build-system gnu-build-system) (arguments `(#:modules ((guix build gnu-build-system) @@ -3047,11 +3047,15 @@ replacement for the @code{urlview} program.") (inputs `(("guile-debbugs" ,guile-debbugs) ("guile-email" ,guile-email) + ("guile-gcrypt" ,guile-gcrypt) ("guile-json" ,guile-json-3) + ("guile-redis" ,guile-redis) ("guile-sqlite3" ,guile-sqlite3) ("guile-syntax-highlight" ,guile-syntax-highlight) + ("guile-webutils" ,guile-webutils) ("gnutls" ,gnutls) ;needed to talk to https://debbugs.gnu.org ("guile" ,guile-2.2) + ("mailutils" ,mailutils) ("mumimu" ,mumimu))) ;'mumimu' executable recorded in (mumi config) (native-inputs `(("autoconf" ,autoconf) diff --git a/gnu/services/web.scm b/gnu/services/web.scm index fa5c34d5af..c73ff5ebfc 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -262,6 +262,14 @@ patchwork-virtualhost patchwork-service-type + + mumi-configuration + mumi-configuration? + mumi-configuration-mumi + mumi-configuration-mailer? + mumi-configuration-sender + mumi-configuration-smtp + mumi-service-type)) ;;; Commentary: @@ -1678,6 +1686,14 @@ WSGIPassAuthorization On ;;; Mumi. ;;; +(define-record-type* + mumi-configuration make-mumi-configuration + mumi-configuration? + (mumi mumi-configuration-mumi (default mumi)) + (mailer? mumi-configuration-mailer? (default #t)) + (sender mumi-configuration-sender) + (smtp mumi-configuration-smtp)) + (define %mumi-activation (with-imported-modules '((guix build utils)) #~(begin @@ -1702,25 +1718,43 @@ WSGIPassAuthorization On (home-directory "/var/empty") (shell (file-append shadow "/sbin/nologin"))))) -(define (mumi-shepherd-services mumi) - (list (shepherd-service - (provision '(mumi)) - (documentation "Mumi bug-tracking web interface.") - (requirement '(networking)) - (start #~(make-forkexec-constructor - '(#$(file-append mumi "/bin/mumi")) - #:user "mumi" #:group "mumi" - #:log-file "/var/log/mumi.log")) - (stop #~(make-kill-destructor))) - (shepherd-service - (provision '(mumi-worker)) - (documentation "Mumi bug-tracking web interface.") - (requirement '(networking)) - (start #~(make-forkexec-constructor - '(#$(file-append mumi "/bin/mumi") "--worker") - #:user "mumi" #:group "mumi" - #:log-file "/var/log/mumi.worker.log")) - (stop #~(make-kill-destructor))))) +(define (mumi-shepherd-services config) + (match config + (($ mumi mailer? sender smtp) + (list (shepherd-service + (provision '(mumi)) + (documentation "Mumi bug-tracking web interface.") + (requirement '(networking)) + (start #~(make-forkexec-constructor + `(#$(file-append mumi "/bin/mumi") "web" + ,@(if mailer? '() '("--disable-mailer"))) + #:user "mumi" #:group "mumi" + #:log-file "/var/log/mumi.log")) + (stop #~(make-kill-destructor))) + (shepherd-service + (provision '(mumi-worker)) + (documentation "Mumi bug-tracking web interface database worker.") + (requirement '(networking)) + (start #~(make-forkexec-constructor + '(#$(file-append mumi "/bin/mumi") "worker") + #:user "mumi" #:group "mumi" + #:log-file "/var/log/mumi.worker.log")) + (stop #~(make-kill-destructor))) + (shepherd-service + (provision '(mumi-mailer)) + (documentation "Mumi bug-tracking web interface mailer.") + (requirement '(networking)) + (start #~(make-forkexec-constructor + `(#$(file-append mumi "/bin/mumi") "mailer" + ,@(if sender + (list (string-append "--sender=" sender)) + '()) + ,@(if smtp + (list (string-append "--smtp=" smtp)) + '())) + #:user "mumi" #:group "mumi" + #:log-file "/var/log/mumi.mailer.log")) + (stop #~(make-kill-destructor))))))) (define mumi-service-type (service-type @@ -1734,4 +1768,5 @@ WSGIPassAuthorization On mumi-shepherd-services))) (description "Run Mumi, a Web interface to the Debbugs bug-tracking server.") - (default-value mumi))) + (default-value + (mumi-configuration)))) -- cgit v1.2.3 From d636e54c270a3ff427f4f94366b5f2049808c170 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 6 Apr 2020 10:16:28 +0200 Subject: doc: Make 'fc-cache -rv' instructions more prominent. * doc/guix.texi (Application Setup): Move the "fc-cache" instructions next to the Fontconfig paragraph and make the command more visible. --- doc/guix.texi | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 12094e0feb..4d1acf1342 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -1685,6 +1685,17 @@ to display fonts, you have to install fonts with Guix as well. Essential font packages include @code{gs-fonts}, @code{font-dejavu}, and @code{font-gnu-freefont-ttf}. +@cindex @code{fc-cache} +@cindex font cache +Once you have installed or removed fonts, or when you notice an +application that does not find fonts, you may need to install Fontconfig +and to force an update of its font cache by running: + +@example +guix install fontconfig +fc-cache -rv +@end example + To display text written in Chinese languages, Japanese, or Korean in graphical applications, consider installing @code{font-adobe-source-han-sans} or @code{font-wqy-zenhei}. The former @@ -1718,13 +1729,6 @@ xset +fp $(dirname $(readlink -f ~/.guix-profile/share/fonts/truetype/fonts.dir) After that, you can run @code{xlsfonts} (from @code{xlsfonts} package) to make sure your TrueType fonts are listed there. -@cindex @code{fc-cache} -@cindex font cache -After installing fonts you may have to refresh the font cache to use -them in applications. The same applies when applications installed via -Guix do not seem to find fonts. To force rebuilding of the font cache -run @code{fc-cache -rv}. The @code{fc-cache} command is provided by -the @code{fontconfig} package. @subsection X.509 Certificates -- cgit v1.2.3 From 0468455e7d279c89ea3ad1b51935efb2b785ec47 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 6 Apr 2020 11:47:04 +0200 Subject: services: Add 'rottlog-service-type' to '%base-services'. * gnu/services/base.scm (%base-services): Add an instance of ROTTLOG-SERVICE-TYPE. * doc/guix.texi (Log Rotation): Mention that it's part of %BASE-SERVICES and change example. --- doc/guix.texi | 20 +++++++++++++++----- gnu/services/base.scm | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 4d1acf1342..450ca3c5d8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -13186,17 +13186,27 @@ their contents in separate files, possibly compressed. The @code{(gnu services admin)} module provides an interface to GNU@tie{}Rot[t]log, a log rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}). -The example below defines an operating system that provides log rotation -with the default settings, for commonly encountered log files. +This service is part of @code{%base-services}, and thus enabled by +default, with the default settings, for commonly encountered log files. +The example below shows how to extend it with an additional +@dfn{rotation}, should you need to do that (usually, services that +produce log files already take care of that): @lisp (use-modules (guix) (gnu)) -(use-service-modules admin mcron) -(use-package-modules base idutils) +(use-service-modules admin) + +(define my-log-files + ;; Log files that I want to rotate. + '("/var/log/something.log" "/var/log/another.log")) (operating-system ;; @dots{} - (services (cons (service rottlog-service-type) + (services (cons (simple-service 'rotate-my-stuff + rottlog-service-type + (list (log-rotation + (frequency 'daily) + (files my-log-files)))) %base-services))) @end lisp diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 8d9a563e2b..a0179c0259 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2444,6 +2444,8 @@ to handle." (service guix-service-type) (service nscd-service-type) + (service rottlog-service-type) + ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is ;; used, so enable them by default. The FUSE and ALSA rules are ;; less critical, but handy. -- cgit v1.2.3 From 3302e03ba0edca49347c6a2b215e56bd53a6b113 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 7 Apr 2020 12:13:04 +0200 Subject: services: guix: Add 'set-http-proxy' action. Fixes . Reported by Divan Santana . * gnu/services/base.scm (shepherd-set-http-proxy-action): New procedure. (guix-shepherd-service): Add 'actions' field. Change 'start' to a lambda; check the value of the "http_proxy" environment variable and add "http_proxy" and "https_proxy" to #:environment-variables as a function of that. * gnu/tests/base.scm (run-basic-test)["guix-daemon set-http-proxy action", "guix-daemon set-http-proxy action, clear"]: New tests. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 19 ++++++++- gnu/services/base.scm | 113 +++++++++++++++++++++++++++++++++----------------- gnu/tests/base.scm | 15 +++++++ 3 files changed, 106 insertions(+), 41 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 450ca3c5d8..7169e03516 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12779,9 +12779,24 @@ List of extra command-line options for @command{guix-daemon}. File where @command{guix-daemon}'s standard output and standard error are written. +@cindex HTTP proxy, for @code{guix-daemon} +@cindex proxy, for @code{guix-daemon} HTTP access @item @code{http-proxy} (default: @code{#f}) -The HTTP proxy used for downloading fixed-output derivations and -substitutes. +The URL of the HTTP and HTTPS proxy used for downloading fixed-output +derivations and substitutes. + +It is also possible to change the daemon's proxy at run time through the +@code{set-http-proxy} action, which restarts it: + +@example +herd set-http-proxy guix-daemon http://localhost:8118 +@end example + +To clear the proxy settings, run: + +@example +herd set-http-proxy guix-daemon +@end example @item @code{tmpdir} (default: @code{#f}) A directory path where the @command{guix-daemon} will perform builds. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index f802005e3c..cb556e87bc 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1640,6 +1640,30 @@ archive' public keys, with GUIX." (define %default-guix-configuration (guix-configuration)) +(define shepherd-set-http-proxy-action + ;; Shepherd action to change the HTTP(S) proxy. + (shepherd-action + (name 'set-http-proxy) + (documentation + "Change the HTTP(S) proxy used by 'guix-daemon' and restart it.") + (procedure #~(lambda* (_ #:optional proxy) + (let ((environment (environ))) + ;; A bit of a hack: communicate PROXY to the 'start' + ;; method via environment variables. + (if proxy + (begin + (format #t "changing HTTP/HTTPS \ +proxy of 'guix-daemon' to ~s...~%" + proxy) + (setenv "http_proxy" proxy)) + (begin + (format #t "clearing HTTP/HTTPS \ +proxy of 'guix-daemon'...~%") + (unsetenv "http_proxy"))) + (action 'guix-daemon 'restart) + (environ environment) + #t))))) + (define (guix-shepherd-service config) "Return a for the Guix daemon service with CONFIG." (match-record config @@ -1651,47 +1675,58 @@ archive' public keys, with GUIX." (documentation "Run the Guix daemon.") (provision '(guix-daemon)) (requirement '(user-processes)) + (actions (list shepherd-set-http-proxy-action)) (modules '((srfi srfi-1))) (start - #~(make-forkexec-constructor - (cons* #$(file-append guix "/bin/guix-daemon") - "--build-users-group" #$build-group - "--max-silent-time" #$(number->string max-silent-time) - "--timeout" #$(number->string timeout) - "--log-compression" #$(symbol->string log-compression) - #$@(if use-substitutes? - '() - '("--no-substitutes")) - "--substitute-urls" #$(string-join substitute-urls) - #$@extra-options - - ;; Add CHROOT-DIRECTORIES and all their dependencies (if - ;; these are store items) to the chroot. - (append-map (lambda (file) - (append-map (lambda (directory) - (list "--chroot-directory" - directory)) - (call-with-input-file file - read))) - '#$(map references-file chroot-directories))) - - #:environment-variables - (list #$@(if http-proxy - (list (string-append "http_proxy=" http-proxy)) - '()) - #$@(if tmpdir - (list (string-append "TMPDIR=" tmpdir)) - '()) - - ;; Make sure we run in a UTF-8 locale so that 'guix - ;; offload' correctly restores nars that contain UTF-8 - ;; file names such as 'nss-certs'. See - ;; . - (string-append "GUIX_LOCPATH=" - #$glibc-utf8-locales "/lib/locale") - "LC_ALL=en_US.utf8") - - #:log-file #$log-file)) + #~(lambda _ + (define proxy + ;; HTTP/HTTPS proxy. The 'http_proxy' variable is set by + ;; the 'set-http-proxy' action. + (or (getenv "http_proxy") #$http-proxy)) + + (fork+exec-command + (cons* #$(file-append guix "/bin/guix-daemon") + "--build-users-group" #$build-group + "--max-silent-time" #$(number->string max-silent-time) + "--timeout" #$(number->string timeout) + "--log-compression" #$(symbol->string log-compression) + #$@(if use-substitutes? + '() + '("--no-substitutes")) + "--substitute-urls" #$(string-join substitute-urls) + #$@extra-options + + ;; Add CHROOT-DIRECTORIES and all their dependencies + ;; (if these are store items) to the chroot. + (append-map (lambda (file) + (append-map (lambda (directory) + (list "--chroot-directory" + directory)) + (call-with-input-file file + read))) + '#$(map references-file + chroot-directories))) + + #:environment-variables + (append (list #$@(if tmpdir + (list (string-append "TMPDIR=" tmpdir)) + '()) + + ;; Make sure we run in a UTF-8 locale so that + ;; 'guix offload' correctly restores nars that + ;; contain UTF-8 file names such as + ;; 'nss-certs'. See + ;; . + (string-append "GUIX_LOCPATH=" + #$glibc-utf8-locales + "/lib/locale") + "LC_ALL=en_US.utf8") + (if proxy + (list (string-append "http_proxy=" proxy) + (string-append "https_proxy=" proxy)) + '())) + + #:log-file #$log-file))) (stop #~(make-kill-destructor)))))) (define (guix-accounts config) diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index fe63cecbd0..086d2a133f 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -459,6 +459,21 @@ info --version") (marionette-eval '(readlink "/var/guix/gcroots/profiles") marionette)) + (test-equal "guix-daemon set-http-proxy action" + '(#t) ;one value, #t + (marionette-eval '(with-shepherd-action 'guix-daemon + ('set-http-proxy "http://localhost:8118") + result + result) + marionette)) + + (test-equal "guix-daemon set-http-proxy action, clear" + '(#t) ;one value, #t + (marionette-eval '(with-shepherd-action 'guix-daemon + ('set-http-proxy) + result + result) + marionette)) (test-assert "screendump" (begin -- cgit v1.2.3 From 8c04471f2403f05bcbea740e3722030e2b8311ec Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 8 Apr 2020 12:28:25 +0200 Subject: doc: Mention HTTP/HTTPS proxy in the system installation instructions. * doc/guix.texi (Keyboard Layout and Networking and Partitioning): Mention 'herd set-http-proxy guix-daemon'. --- doc/guix.texi | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 7169e03516..891e2693f6 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2203,6 +2203,18 @@ ping -c 3 gnu.org Setting up network access is almost always a requirement because the image does not contain all the software and tools that may be needed. +@cindex proxy, during system installation +If you need HTTP and HTTPS access to go through a proxy, run the +following command: + +@example +herd set-http-proxy guix-daemon @var{URL} +@end example + +@noindent +where @var{URL} is the proxy URL, for example +@code{http://example.org:8118}. + @cindex installing over SSH If you want to, you can continue the installation remotely by starting an SSH server: -- cgit v1.2.3 From da9deba13d551e316f5a99a614834efa27ddc7d1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 13 Apr 2020 00:12:20 +0200 Subject: doc: Emit hyperlinks in HTML output for @lisp snippets. This makes it easier to jump to the definition of a procedure or variable when looking at a code snippet. There can be false-positive because scoping rules are ignored, for example, but it should be a good approximation. * doc/build.scm (syntax-highlighted-html)[build](highlights->sxml*): Add 'anchors' parameter. Add clause for ('symbol text). (syntax-highlight): Add 'anchors' parameter. Wrap body in named let and use it in recursive calls. Pass ANCHORS to 'highlights->sxml*'. (underscore-decode, anchor-id->key, collect-anchors, html?): New procedures. (process-file): Add 'anchors' parameter. and honor it. Rewrite mono-node and multi-node HTML files separately. --- doc/build.scm | 163 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 130 insertions(+), 33 deletions(-) (limited to 'doc') diff --git a/doc/build.scm b/doc/build.scm index 8d5b58962a..c3d61f837b 100644 --- a/doc/build.scm +++ b/doc/build.scm @@ -220,8 +220,10 @@ its
 blocks (as produced by 'makeinfo --html')."
                          (syntax-highlight scheme)
                          (syntax-highlight lexers)
                          (guix build utils)
+                         (srfi srfi-1)
                          (ice-9 match)
-                         (ice-9 threads))
+                         (ice-9 threads)
+                         (ice-9 vlist))
 
             (define (pair-open/close lst)
               ;; Pair 'open' and 'close' tags produced by 'highlights' and
@@ -255,10 +257,11 @@ its 
 blocks (as produced by 'makeinfo --html')."
                              level (reverse result)))
                    (values (reverse result) "" '())))))
 
-            (define (highlights->sxml* highlights)
+            (define (highlights->sxml* highlights anchors)
               ;; Like 'highlights->sxml', but handle nested 'paren tags.  This
               ;; allows for paren matching highlights via appropriate CSS
-              ;; "hover" properties.
+              ;; "hover" properties.  When a symbol is encountered, look it up
+              ;; in ANCHORS, a vhash, and emit the corresponding href, if any.
               (define (tag->class tag)
                 (string-append "syntax-" (symbol->string tag)))
 
@@ -269,8 +272,16 @@ its 
 blocks (as produced by 'makeinfo --html')."
                                                        (number->string level))))
                              ,open
                              (span (@ (class "syntax-symbol"))
-                                   ,@(highlights->sxml* body))
+                                   ,@(highlights->sxml* body anchors))
                              ,close))
+                     (('symbol text)
+                      ;; Check whether we can emit a hyperlink for TEXT.
+                      (match (vhash-assoc text anchors)
+                        (#f
+                         `(span (@ (class ,(tag->class 'symbol))) ,text))
+                        ((_ . target)
+                         `(a (@ (class ,(tag->class 'symbol)) (href ,target))
+                             ,text))))
                      ((tag text)
                       `(span (@ (class ,(tag->class tag))) ,text)))
                    highlights))
@@ -301,35 +312,95 @@ its 
 blocks (as produced by 'makeinfo --html')."
                    (pk 'unsupported-code-snippet something)
                    (primitive-exit 1)))))
 
-            (define (syntax-highlight sxml)
+            (define (syntax-highlight sxml anchors)
               ;; Recurse over SXML and syntax-highlight code snippets.
-              (match sxml
-                (('*TOP* decl body ...)
-                 `(*TOP* ,decl ,@(map syntax-highlight body)))
-                (('head things ...)
-                 `(head ,@things
-                        (link (@ (rel "stylesheet")
-                                 (type "text/css")
-                                 (href #$syntax-css-url)))))
-                (('pre ('@ ('class "lisp")) code-snippet ...)
-                 `(pre (@ (class "lisp"))
-                       ,@(highlights->sxml*
-                          (pair-open/close
-                           (highlight lex-scheme
-                                      (concatenate-snippets code-snippet))))))
-                ((tag ('@ attributes ...) body ...)
-                 `(,tag (@ ,@attributes) ,@(map syntax-highlight body)))
-                ((tag body ...)
-                 `(,tag ,@(map syntax-highlight body)))
-                ((? string? str)
-                 str)))
-
-            (define (process-html file)
+              (let loop ((sxml sxml))
+                (match sxml
+                  (('*TOP* decl body ...)
+                   `(*TOP* ,decl ,@(map loop body)))
+                  (('head things ...)
+                   `(head ,@things
+                          (link (@ (rel "stylesheet")
+                                   (type "text/css")
+                                   (href #$syntax-css-url)))))
+                  (('pre ('@ ('class "lisp")) code-snippet ...)
+                   `(pre (@ (class "lisp"))
+                         ,@(highlights->sxml*
+                            (pair-open/close
+                             (highlight lex-scheme
+                                        (concatenate-snippets code-snippet)))
+                            anchors)))
+                  ((tag ('@ attributes ...) body ...)
+                   `(,tag (@ ,@attributes) ,@(map loop body)))
+                  ((tag body ...)
+                   `(,tag ,@(map loop body)))
+                  ((? string? str)
+                   str))))
+
+            (define (underscore-decode str)
+              ;; Decode STR, an "underscore-encoded" string as produced by
+              ;; makeinfo for indexes, such as "_0025base_002dservices" for
+              ;; "%base-services".
+              (let loop ((str str)
+                         (result '()))
+                (match (string-index str #\_)
+                  (#f
+                   (string-concatenate-reverse (cons str result)))
+                  (index
+                   (let ((char (string->number
+                                (substring str (+ index 1) (+ index 5))
+                                16)))
+                     (loop (string-drop str (+ index 5))
+                           (append (list (string (integer->char char))
+                                         (string-take str index))
+                                   result)))))))
+
+            (define (anchor-id->key id)
+              ;; Convert ID, an anchor ID such as
+              ;; "index-pam_002dlimits_002dservice" to the corresponding key,
+              ;; "pam-limits-service" in this example.
+              (underscore-decode
+               (string-drop id (string-length "index-"))))
+
+            (define* (collect-anchors file #:optional (vhash vlist-null))
+              ;; Collect the anchors that appear in FILE, a makeinfo-generated
+              ;; file.  Grab those from 
tags, which corresponds to + ;; Texinfo @deftp, @defvr, etc. Return VHASH augmented with + ;; more name/reference pairs. + (define string-or-entity? + (match-lambda + ((? string?) #t) + (('*ENTITY* _ ...) #t) + (_ #f))) + + (let ((shtml (call-with-input-file file html->shtml))) + (let loop ((shtml shtml) + (vhash vhash)) + (match shtml + ;; Attempt to match: + ;;
Scheme Variable: x
+ ;; but not: + ;;
cups-configuration parameter: …
+ (('dt ('@ ('id id)) + (? string-or-entity?) ... ('strong _ ...) _ ...) + (if (string-prefix? "index-" id) + (vhash-cons (anchor-id->key id) + (string-append (basename file) + "#" id) + vhash) + vhash)) + ((tag ('@ _ ...) body ...) + (fold loop vhash body)) + ((tag body ...) + (fold loop vhash body)) + (_ vhash))))) + + (define (process-html file anchors) ;; Parse FILE and perform syntax highlighting for its Scheme ;; snippets. Install the result to #$output. (format (current-error-port) "processing ~a...~%" file) (let* ((shtml (call-with-input-file file html->shtml)) - (highlighted (syntax-highlight shtml)) + (highlighted (syntax-highlight shtml anchors)) (base (string-drop file (string-length #$input))) (target (string-append #$output base))) (mkdir-p (dirname target)) @@ -352,17 +423,43 @@ its
 blocks (as produced by 'makeinfo --html')."
                       (pk 'error-link file target (strerror errno))
                       (primitive-exit 3))))))
 
+            (define (html? file stat)
+              (string-suffix? ".html" file))
+
             ;; Install a UTF-8 locale so we can process UTF-8 files.
             (setenv "GUIX_LOCPATH"
                     #+(file-append glibc-utf8-locales "/lib/locale"))
             (setlocale LC_ALL "en_US.utf8")
 
+            ;; First process the mono-node 'guix.html' files.
             (n-par-for-each (parallel-job-count)
-                            (lambda (file)
-                              (if (string-suffix? ".html" file)
-                                  (process-html file)
-                                  (copy-as-is file)))
-                            (find-files #$input))))))
+                            (lambda (mono)
+                              (let ((anchors (collect-anchors mono)))
+                                (process-html mono anchors)))
+                            (find-files #$input "^guix(\\.[a-zA-Z_-]+)?\\.html$"))
+
+            ;; Next process the multi-node HTML files in two phases: (1)
+            ;; collect the list of anchors, and (2) perform
+            ;; syntax-highlighting.
+            (let* ((multi   (find-files #$input "^html_node$"
+                                        #:directories? #t))
+                   (anchors (n-par-map (parallel-job-count)
+                                       (lambda (multi)
+                                         (cons multi
+                                               (fold collect-anchors vlist-null
+                                                     (find-files multi html?))))
+                                       multi)))
+              (n-par-for-each (parallel-job-count)
+                              (lambda (file)
+                                (let ((anchors (assoc-ref anchors (dirname file))))
+                                  (process-html file anchors)))
+                              (append-map (lambda (multi)
+                                            (find-files multi html?))
+                                          multi)))
+
+            ;; Last, copy non-HTML files as is.
+            (for-each copy-as-is
+                      (find-files #$input (negate html?)))))))
 
   (computed-file name build))
 
-- 
cgit v1.2.3


From c2480d10422f176bf06081de9d601f3b7249a83c Mon Sep 17 00:00:00 2001
From: Ludovic Courtès 
Date: Mon, 13 Apr 2020 02:09:09 +0200
Subject: doc: Avoid invalid 'match' pattern in 'syntax-highlighted-html'.

This is a followup to da9deba13d551e316f5a99a614834efa27ddc7d1.

Last-minute modification of the 'match' pattern would lead to an error:

  "multiple ellipsis patterns not allowed at same level"

* doc/build.scm (syntax-highlighted-html)[build](collect-anchors):
Add 'worthy-entry?' procedure and use it instead of the unsupported
pattern for ('dt ...).
---
 doc/build.scm | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

(limited to 'doc')

diff --git a/doc/build.scm b/doc/build.scm
index c3d61f837b..ca81d813a9 100644
--- a/doc/build.scm
+++ b/doc/build.scm
@@ -373,17 +373,26 @@ its 
 blocks (as produced by 'makeinfo --html')."
                   (('*ENTITY* _ ...) #t)
                   (_ #f)))
 
+              (define (worthy-entry? lst)
+                ;; Attempt to match:
+                ;;   Scheme Variable: x
+                ;; but not:
+                ;;   cups-configuration parameter: …
+                (let loop ((lst lst))
+                  (match lst
+                    (((? string-or-entity?) rest ...)
+                     (loop rest))
+                    ((('strong _ ...) _ ...)
+                     #t)
+                    (_ #f))))
+
               (let ((shtml (call-with-input-file file html->shtml)))
                 (let loop ((shtml shtml)
                            (vhash vhash))
                   (match shtml
-                    ;; Attempt to match:
-                    ;;  
Scheme Variable: x
- ;; but not: - ;;
cups-configuration parameter: …
- (('dt ('@ ('id id)) - (? string-or-entity?) ... ('strong _ ...) _ ...) - (if (string-prefix? "index-" id) + (('dt ('@ ('id id)) rest ...) + (if (and (string-prefix? "index-" id) + (worthy-entry? rest)) (vhash-cons (anchor-id->key id) (string-append (basename file) "#" id) -- cgit v1.2.3 From deac7bf6ac7a943c9685949bf4dda7a2b1ba56c3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 13 Apr 2020 12:27:17 +0200 Subject: doc: Improve anchor collection. This allows us to catch "operating_002dsystem-1", for instance. * doc/build.scm (syntax-highlighted-html)[build](anchor-id->key): Drop "-1" & co. from ID. --- doc/build.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/build.scm b/doc/build.scm index ca81d813a9..994b94eae2 100644 --- a/doc/build.scm +++ b/doc/build.scm @@ -221,6 +221,7 @@ its
 blocks (as produced by 'makeinfo --html')."
                          (syntax-highlight lexers)
                          (guix build utils)
                          (srfi srfi-1)
+                         (srfi srfi-26)
                          (ice-9 match)
                          (ice-9 threads)
                          (ice-9 vlist))
@@ -358,9 +359,14 @@ its 
 blocks (as produced by 'makeinfo --html')."
             (define (anchor-id->key id)
               ;; Convert ID, an anchor ID such as
               ;; "index-pam_002dlimits_002dservice" to the corresponding key,
-              ;; "pam-limits-service" in this example.
-              (underscore-decode
-               (string-drop id (string-length "index-"))))
+              ;; "pam-limits-service" in this example.  Drop the suffix of
+              ;; duplicate anchor IDs like "operating_002dsystem-1".
+              (let ((id (if (any (cut string-suffix? <> id)
+                                 '("-1" "-2" "-3" "-4" "-5"))
+                            (string-drop-right id 2)
+                            id)))
+                (underscore-decode
+                 (string-drop id (string-length "index-")))))
 
             (define* (collect-anchors file #:optional (vhash vlist-null))
               ;; Collect the anchors that appear in FILE, a makeinfo-generated
-- 
cgit v1.2.3


From 1373cb40809c6c87c56e771fb51600bd18187016 Mon Sep 17 00:00:00 2001
From: Brice Waegeneire 
Date: Sun, 12 Apr 2020 19:58:28 +0200
Subject: doc: Fix typo.

* doc/guix.texi (Web Services)[nginx-php-fpm-location]: Replace
'nginx-php-fpm-location' by 'nginx-php-location'.

Signed-off-by: Christopher Baines 
---
 doc/guix.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'doc')

diff --git a/doc/guix.texi b/doc/guix.texi
index 891e2693f6..9ddd266b2b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20919,7 +20919,7 @@ The time in seconds after which a process with no requests is killed.
 @end deftp
 
 
-@deffn {Scheme Procedure} nginx-php-fpm-location @
+@deffn {Scheme Procedure} nginx-php-location @
        [#:nginx-package nginx] @
        [socket (string-append "/var/run/php" @
                               (version-major (package-version php)) @
-- 
cgit v1.2.3


From b44e19acd1a0d449427cea0333f02ac98605be1c Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Wed, 15 Apr 2020 19:11:32 +0200
Subject: doc: Fix typo.

* doc/guix.texi (Running Guix in a VM): Add missing reference to
`spice-vdagent-service' and misuse of @pxref.
---
 doc/guix.texi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'doc')

diff --git a/doc/guix.texi b/doc/guix.texi
index 9ddd266b2b..ef5f68db24 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -27340,7 +27340,8 @@ VM.  To enable that you'll also have to pass the following flags to @command{qem
 name=com.redhat.spice.0
 @end example
 
-You'll also need to add the @pxref{Miscellaneous Services, Spice service}.
+You'll also need to add the @code{(spice-vdagent-service)} to your
+system definition (@pxref{Miscellaneous Services, Spice service}).
 
 @node Defining Services
 @section Defining Services
-- 
cgit v1.2.3


From 33f3fef383d066460b4bffc4b5af89b639cb55f3 Mon Sep 17 00:00:00 2001
From: Ludovic Courtès 
Date: Thu, 16 Apr 2020 15:04:55 +0200
Subject: doc: Remove bogus index entry.

* doc/guix.texi (Build Systems): Remove bogus and redundant entry for
'copy-build-system'.
---
 doc/guix.texi | 1 -
 1 file changed, 1 deletion(-)

(limited to 'doc')

diff --git a/doc/guix.texi b/doc/guix.texi
index ef5f68db24..13c39427b8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6171,7 +6171,6 @@ if they are defined by the crate.
 
 
 @defvr {Scheme Variable} copy-build-system
-@cindex (copy build system)
 This variable is exported by @code{(guix build-system copy)}.  It
 supports builds of simple packages that don't require much compiling,
 mostly just moving files around.
-- 
cgit v1.2.3


From cc36b7c8556c651a5b154f83523ede6babc8be73 Mon Sep 17 00:00:00 2001
From: R Veera Kumar 
Date: Thu, 16 Apr 2020 21:36:38 +0530
Subject: doc: Add dicod-service-type in Dictionary Services.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* doc/guix.texi (Miscellaneous Services): Add dicod-service-type
in Dictionary Services.

Signed-off-by: Ludovic Courtès 
---
 doc/guix.texi | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'doc')

diff --git a/doc/guix.texi b/doc/guix.texi
index 13c39427b8..5c4f90cfcb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -77,6 +77,7 @@ Copyright @copyright{} 2020 Jakub Kądziołka@*
 Copyright @copyright{} 2020 Jack Hill@*
 Copyright @copyright{} 2020 Naga Malleswari@*
 Copyright @copyright{} 2020 Brice Waegeneire@*
+Copyright @copyright{} 2020 R Veera Kumar@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -25633,6 +25634,11 @@ If true, this must be the name of a file to log messages to.
 @cindex dictionary
 The @code{(gnu services dict)} module provides the following service:
 
+@defvr {Scheme Variable} dicod-service-type
+This is the type of the service that runs the @command{dicod} daemon, an
+implementation of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
+@end defvr
+
 @deffn {Scheme Procedure} dicod-service [#:config (dicod-configuration)]
 Return a service that runs the @command{dicod} daemon, an implementation
 of DICT server (@pxref{Dicod,,, dico, GNU Dico Manual}).
-- 
cgit v1.2.3


From c9f321e52a99dea93fcc099372ea0167150b9aac Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus 
Date: Thu, 16 Apr 2020 22:22:51 +0200
Subject: doc: Document building and installing from JSON files.

* doc/guix.texi (Invoking guix package): Augment pargraphs for
"--install-from-file".
(Invoking guix build): Document building from JSON files.
* doc/package-hello.json: New file.
* doc/local.mk (EXTRA_DIST): Add it.
---
 doc/guix.texi          | 18 ++++++++++++++++++
 doc/local.mk           |  3 ++-
 doc/package-hello.json | 31 +++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 doc/package-hello.json

(limited to 'doc')

diff --git a/doc/guix.texi b/doc/guix.texi
index 5c4f90cfcb..a475ebb45a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2824,6 +2824,15 @@ in the root of their project source tree that can be used to test
 development snapshots and create reproducible development environments
 (@pxref{Invoking guix environment}).
 
+The @var{file} may also contain a JSON representation of one or more
+package definitions.  Running @code{guix package -f} on
+@file{hello.json} with the following contents would result in installing
+the package @code{greeter} after building @code{myhello}:
+
+@example
+@verbatiminclude package-hello.json
+@end example
+
 @item --remove=@var{package} @dots{}
 @itemx -r @var{package} @dots{}
 Remove the specified @var{package}s.
@@ -8550,6 +8559,15 @@ As an example, @var{file} might contain a package definition like this
 @include package-hello.scm
 @end lisp
 
+The @var{file} may also contain a JSON representation of one or more
+package definitions.  Running @code{guix build -f} on @file{hello.json}
+with the following contents would result in building the packages
+@code{