From 1cff19d8d4d99f502db43cff6e9e7472197256f4 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 18 Feb 2024 12:39:26 +0100 Subject: services: virtual-build-machine: Add ‘configuration’ action. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/virtualization.scm (build-vm-shepherd-services): Add ‘configuration’ action. * doc/guix.texi (Virtualization Services): Document it. Change-Id: I4734e096d744b3cda0d523692498a73c0029e188 --- doc/guix.texi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 04119a5955..fe6f82d4a5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -36396,7 +36396,11 @@ set to a date several years in the past, and on a CPU model that corresponds to that date---a model possibly older than that of your machine. This lets you rebuild today software from the past that would otherwise fail to build due to a time trap or other issues in its build -process. +process. You can view the VM's config like this: + +@example +herd configuration build-vm +@end example You can configure the build VM, as in this example: -- cgit 1.4.1 From 0a7bf792c88ebaf0ec6c55e03a4f587bd5597796 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sun, 13 Aug 2023 12:37:04 +0200 Subject: services: Add whoogle-service-type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/web.scm (whoogle-service-type): New variable. * doc/guix.texi (Web Services): Document it. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 32 ++++++++++++++++++++++++++++++ gnu/services/web.scm | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index fe6f82d4a5..31e4869117 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31863,6 +31863,38 @@ Additional arguments to pass to the @command{varnishd} process. @end table @end deftp +@subheading Whoogle Search +@cindex Whoogle Search +@uref{https://github.com/benbusby/whoogle-search, Whoogle Search} is a +self-hosted, ad-free, privacy-respecting metasearch engine that collects +and displays Google search results. + +@defvar whoogle-service-type +Service type for Whoogle Search. +@end defvar + +@deftp {Data Type} whoogle-configuration +Data type representing Whoogle Search service configuration. + +@table @asis +@item @code{package} (default: @code{whoogle-search}) +The Whoogle Search package to use. + +@item @code{host} (default: @code{"127.0.0.1"}) +The host address to run Whoogle on. + +@item @code{port} (default: @code{5000}) +The port where Whoogle will be exposed. + +@item @code{environment-variables} (default: @code{'()}) +A list of strings with the environment variables to configure Whoogle. +You can consult +@uref{https://github.com/benbusby/whoogle-search/blob/main/whoogle.template.env, +its environment variables template} for the list of available options. + +@end table +@end deftp + @subsubheading Patchwork @cindex Patchwork Patchwork is a patch tracking system. It can collect patches sent to a diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 05fd71f994..406117c457 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2020, 2021 Alexandru-Sergiu Marton ;;; Copyright © 2022 Simen Endsjø ;;; Copyright © 2023 Bruno Victal +;;; Copyright © 2023 Miguel Ángel Moreno ;;; ;;; This file is part of GNU Guix. ;;; @@ -36,6 +37,7 @@ #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu services admin) + #:use-module (gnu services configuration) #:use-module (gnu services getmail) #:use-module (gnu services mail) #:use-module (gnu system pam) @@ -47,6 +49,7 @@ #:use-module (gnu packages patchutils) #:use-module (gnu packages php) #:use-module (gnu packages python) + #:use-module (gnu packages python-web) #:use-module (gnu packages gnupg) #:use-module (gnu packages guile) #:use-module (gnu packages logging) @@ -240,6 +243,13 @@ varnish-service-type + whoogle-service-type + whoogle-configuration + whoogle-configuration-package + whoogle-configuration-host + whoogle-configuration-port + whoogle-configuration-environment-variables + patchwork-database-configuration patchwork-database-configuration? patchwork-database-configuration-engine @@ -1603,6 +1613,52 @@ files.") (default-value (varnish-configuration)))) + +;;; +;;; Whoogle +;;; + +(define-configuration/no-serialization whoogle-configuration + (package + (package whoogle-search) + "The @code{whoogle-search} package to use.") + (host + (string "127.0.0.1") + "The host address to run Whoogle on.") + (port + (integer 5000) + "The port to run Whoogle on.") + (environment-variables + (list-of-strings '()) + "A list of strings specifying environment variables used to configure +Whoogle.")) + +(define (whoogle-shepherd-service config) + (match-record config + (package host port environment-variables) + (list + (shepherd-service + (provision '(whoogle-search)) + (start #~(make-forkexec-constructor + (list (string-append #$package "/bin/whoogle-search") + "--host" #$host "--port" #$(number->string port)) + #:environment-variables + (append (list "CONFIG_VOLUME=/var/cache/whoogle-search") + '#$environment-variables))) + (stop #~(make-kill-destructor)) + (documentation "Run a @code{whoogle-search} instance."))))) + +(define whoogle-service-type + (service-type + (name 'whoogle-search) + (extensions + (list (service-extension shepherd-root-service-type + whoogle-shepherd-service) + (service-extension profile-service-type + (compose list whoogle-configuration-package)))) + (default-value (whoogle-configuration)) + (description "Set up the @code{whoogle-search} metasearch engine."))) + ;;; ;;; Patchwork -- cgit 1.4.1 From 96ae7b2e33d8f04a67b0bf900ca27dbd0fefaee6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 19 Feb 2024 22:21:17 +0100 Subject: doc: Augment ‘whoogle-service-type’ intro. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Whoogle Search): Enrich a bit. Change-Id: Ib7e1da1c0709167d02c43ab991f3ae34fbc09c84 --- doc/guix.texi | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 31e4869117..9966a8e697 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -31865,12 +31865,24 @@ Additional arguments to pass to the @command{varnishd} process. @subheading Whoogle Search @cindex Whoogle Search + @uref{https://github.com/benbusby/whoogle-search, Whoogle Search} is a -self-hosted, ad-free, privacy-respecting metasearch engine that collects -and displays Google search results. +self-hosted, ad-free, privacy-respecting meta search engine that collects +and displays Google search results. By default, you can configure it by +adding this line to the @code{services} field of your operating system +declaration: + +@lisp +(service whoogle-service-type) +@end lisp + +As a result, Whoogle Search runs as local Web server, which you can +access by opening @indicateurl{http://localhost:5000} in your browser. +The configuration reference is given below. @defvar whoogle-service-type -Service type for Whoogle Search. +Service type for Whoogle Search. Its value must be a +@code{whoogle-configuration} record---see below. @end defvar @deftp {Data Type} whoogle-configuration -- cgit 1.4.1 From ec9c8b0c1a0982e97375df0ae44af4fdc72c3757 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 21 Feb 2024 11:55:25 -0500 Subject: doc: Refine wording of binary installation introductory text. * doc/guix.texi (Binary Installation): Mention the requirement to use a Hurd or Linux kernel for the binary installation. Suggested-by: Matt Change-Id: Ibc0552f59be4fdaaf8d44a5222e6feb925d3f06f --- doc/guix.texi | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 9966a8e697..34aa3545da 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -732,14 +732,17 @@ ready to use it. @cindex installing Guix from binaries @cindex installer script -This section describes how to install Guix on an arbitrary system from a -self-contained tarball providing binaries for Guix and for all its -dependencies. This is often quicker than installing from source, which -is described in the next sections. The only requirement is to have -GNU@tie{}tar and Xz. +This section describes how to install Guix from a self-contained tarball +providing binaries for Guix and for all its dependencies. This is often +quicker than installing from source, which is described in the next +sections. Binary installation requires a system using a Hurd or Linux +kernel; the GNU@tie{}tar and Xz commands must also be available. + +@quotation Important +This section only applies to systems without Guix. Following it for +existing Guix installations will overwrite important system files. @c Note duplicated from the ``Installation'' node. -@quotation Note We recommend the use of this @uref{https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh, shell installer script}. The script automates the download, installation, and -- cgit 1.4.1 From bf746ae2586030ad70904c151ddd1f8ee6645926 Mon Sep 17 00:00:00 2001 From: Herman Rimm Date: Tue, 20 Feb 2024 21:45:09 +0100 Subject: doc: Note SVN dependency of texlive importer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Invoking guix import): Note dependency and remove duplicated words. Change-Id: I94320db8c8ab3569aa461876522d5560e37a19ea Signed-off-by: Ludovic Courtès --- doc/guix.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 34aa3545da..b761ec58bc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14342,7 +14342,7 @@ statistical and graphical environment}. Information is extracted from the @file{DESCRIPTION} file of the package. -The command command below imports metadata for the Cairo R package: +The command below imports metadata for the Cairo R package: @example guix import cran Cairo @@ -14402,10 +14402,10 @@ Information about the package is obtained from the TeX Live package database, a plain text file that is included in the @code{texlive-scripts} package. The source code is downloaded from possibly multiple locations in the SVN repository of the Tex Live -project. +project. Note that therefore SVN must be installed and in @code{$PATH}; +run @code{guix install subversion} if needed. -The command command below imports metadata for the @code{fontspec} -TeX package: +The command below imports metadata for the @code{fontspec} TeX package: @example guix import texlive fontspec -- cgit 1.4.1 From 635af8628c096526e3a79348f484e641aa05f04a Mon Sep 17 00:00:00 2001 From: Herman Rimm Date: Tue, 20 Feb 2024 21:45:13 +0100 Subject: import: Insert packages into modules alphabetically. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/scripts/import.scm (guix-import): Add 'insert' option. (import-as-definitions): Add procedure. * doc/guix.texi (Invoking guix import): Describe 'insert' option. Change-Id: Id87ea707123630e12bcb6788599acac6895b26c4 Signed-off-by: Ludovic Courtès --- doc/guix.texi | 14 +++++++-- guix/scripts/import.scm | 82 ++++++++++++++++++++++++++++++++----------------- 2 files changed, 65 insertions(+), 31 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index b761ec58bc..671cdab6f8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -124,6 +124,7 @@ Copyright @copyright{} 2023 Thomas Ieong@* Copyright @copyright{} 2023 Saku Laesvuori@* Copyright @copyright{} 2023 Graham James Addis@* Copyright @copyright{} 2023 Tomas Volf@* +Copyright @copyright{} 2024 Herman Rimm@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -14186,12 +14187,21 @@ is a package definition, or a template thereof, in the format we know The general syntax is: @example -guix import @var{importer} @var{options}@dots{} +guix import [@var{global-options}@dots{}] @var{importer} @var{package} [@var{options}@dots{}] @end example @var{importer} specifies the source from which to import package metadata, and @var{options} specifies a package identifier and other -options specific to @var{importer}. +options specific to @var{importer}. @command{guix import} itself has the +following @var{global-options}: + +@table @code +@item --insert=@var{file} +@itemx -i @var{file} +Insert the package definition(s) that the @var{importer} generated into the +specified @var{file}, either in alphabetical order among existing package +definitions, or at the end of the file otherwise. +@end table Some of the importers rely on the ability to run the @command{gpgv} command. For these, GnuPG must be installed and in @code{$PATH}; run @code{guix install diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm index 77fcfe3990..aca4e61f26 100644 --- a/guix/scripts/import.scm +++ b/guix/scripts/import.scm @@ -67,10 +67,39 @@ Run IMPORTER with ARGS.\n")) (display (G_ " -h, --help display this help and exit")) (display (G_ " + -i, --insert insert packages into file alphabetically")) + (display (G_ " -V, --version display version information and exit")) (newline) (show-bug-report-information)) +(define (import-as-definitions importer args proc) + "Wrap package expressions from IMPORTER with 'define-public and invoke +PROC callback." + (if (member importer importers) + (match (apply (resolve-importer importer) args) + ((and expr (or ('package _ ...) + ('let _ ...))) + (proc (package->definition expr))) + ((and expr ('define-public _ ...)) + (proc expr)) + ((expressions ...) + (for-each (lambda (expr) + (match expr + ((and expr (or ('package _ ...) + ('let _ ...))) + (proc (package->definition expr))) + ((and expr ('define-public _ ...)) + (proc expr)))) + expressions)) + (x + (leave (G_ "'~a' import failed~%") importer))) + (let ((hint (string-closest importer importers #:threshold 3))) + (report-error (G_ "~a: invalid importer~%") importer) + (when hint + (display-hint (G_ "Did you mean @code{~a}?~%") hint)) + (exit 1)))) + (define-command (guix-import . args) (category packaging) (synopsis "import a package definition from an external repository") @@ -84,33 +113,28 @@ Run IMPORTER with ARGS.\n")) (exit 0)) ((or ("-V") ("--version")) (show-version-and-exit "guix import")) + ((or ("-i" file importer args ...) + ("--insert" file importer args ...)) + (let ((find-and-insert + (lambda (expr) + (match expr + (('define-public term _ ...) + (let ((source-properties + (find-definition-insertion-location + file term))) + (if source-properties + (insert-expression source-properties expr) + (let ((port (open-file file "a"))) + (pretty-print-with-comments port expr) + (newline port) + (close-port port))))))))) + (import-as-definitions importer args find-and-insert))) ((importer args ...) - (if (member importer importers) - (let ((print (lambda (expr) - (leave-on-EPIPE - (pretty-print-with-comments (current-output-port) expr))))) - (match (apply (resolve-importer importer) args) - ((and expr (or ('package _ ...) - ('let _ ...))) - (print (package->definition expr))) - ((and expr ('define-public _ ...)) - (print expr)) - ((? list? expressions) - (for-each (lambda (expr) - (match expr - ((and expr (or ('package _ ...) - ('let _ ...))) - (print (package->definition expr))) - ((and expr ('define-public _ ...)) - (print expr))) - ;; Two newlines: one after the closing paren, and - ;; one to leave a blank line. - (newline) (newline)) - expressions)) - (x - (leave (G_ "'~a' import failed~%") importer)))) - (let ((hint (string-closest importer importers #:threshold 3))) - (report-error (G_ "~a: invalid importer~%") importer) - (when hint - (display-hint (G_ "Did you mean @code{~a}?~%") hint)) - (exit 1)))))) + (let ((print (lambda (expr) + (leave-on-EPIPE + (pretty-print-with-comments + (current-output-port) expr) + ;; Two newlines: one after the closing paren, and + ;; one to leave a blank line. + (newline) (newline))))) + (import-as-definitions importer args print))))) -- cgit 1.4.1 From b386c11e7804e0b577411d930b60f1e0a4a0382c Mon Sep 17 00:00:00 2001 From: Herman Rimm Date: Tue, 20 Feb 2024 21:45:15 +0100 Subject: import: Do not return package name with json importer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/import/json.scm (json->code): Do not return package names after package expressions. * doc/package-hello.json: Fix comma errors and use valid greeter URL. Change-Id: Id71924e72f690a9bda5fbfdb65a443029adfd158 Signed-off-by: Ludovic Courtès --- doc/package-hello.json | 6 +++--- guix/import/json.scm | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'doc') diff --git a/doc/package-hello.json b/doc/package-hello.json index a47e266e4b..60193e97e6 100644 --- a/doc/package-hello.json +++ b/doc/package-hello.json @@ -6,7 +6,7 @@ "build-system": "gnu", "arguments": { "tests?": false - } + }, "home-page": "https://www.gnu.org/software/hello/", "synopsis": "Hello, GNU world: An example GNU package", "description": "GNU Hello prints a greeting.", @@ -16,11 +16,11 @@ { "name": "greeter", "version": "1.0", - "source": "https://example.com/greeter-1.0.tar.gz", + "source": "mirror://gnu/hello/hello-2.10.tar.gz", "build-system": "gnu", "arguments": { "test-target": "foo", - "parallel-build?": false, + "parallel-build?": false }, "home-page": "https://example.com/", "synopsis": "Greeter using GNU Hello", diff --git a/guix/import/json.scm b/guix/import/json.scm index b87e9918c5..bf346a1bef 100644 --- a/guix/import/json.scm +++ b/guix/import/json.scm @@ -78,14 +78,13 @@ a list of S-expressions, or return #F when the JSON is invalid." #:result (append result (list - (package->code (alist->package pkg names)) - (string->symbol (assoc-ref pkg "name")))))))) - (list #:names '() - #:result '()) - packages)))) + (package->code + (alist->package pkg names)))))))) + (list #:names '() + #:result '()) + packages)))) (package - (list (package->code (alist->package json)) - (string->symbol (assoc-ref json "name"))))))) + (list (package->code (alist->package json))))))) (const #f))) (define (json->scheme-file file) -- cgit 1.4.1