From e5667edf5027ae7efd78eb5abaf0b0b5150454a9 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 9 Nov 2021 13:13:15 +0100 Subject: doc: Fix typo. * doc/guix.texi (Invoking guix shell): Fix a typo. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 3355a535ad..e6980bd060 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5650,7 +5650,7 @@ spawning a @dfn{container} isolated from the rest of the system: guix shell --container emacs gcc-toolchain @end example -The command above spawns an interactive shell in a container when +The command above spawns an interactive shell in a container where nothing but @code{emacs}, @code{gcc-toolchain}, and their dependencies is available. The container lacks network access and shares no files other than the current working directory with the surrounding -- cgit v1.2.3 From b20cd80ff1f3c9eb988a0cc27ed9538b68914608 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 28 Oct 2021 22:14:40 +0200 Subject: import: pypi: Allow imports of a specific version. * guix/import/pypi.scm (latest-version): New procedure. (latest-source-release): Rename to... (source-release): ... this. Add 'version' parameter. (latest-wheel-release): Rename to... (wheel-release): ... this. Add 'version' parameter. (pypi->guix-package): Honor 'version' parameter. (pypi-recursive-import): Add 'version' parameter and honor it. * guix/scripts/import/pypi.scm (guix-import-pypi): Expect a spec. Pass it to 'package-name->name+version'. Pass the 'version' parameter. * tests/pypi.scm ("pypi->guix-package, no wheel"): Exercise the #:version parameter. * doc/guix.texi (Invoking guix import): Document it. --- doc/guix.texi | 10 ++++++++-- guix/import/pypi.scm | 47 +++++++++++++++++++++++--------------------- guix/scripts/import/pypi.scm | 32 ++++++++++++++++-------------- tests/pypi.scm | 12 ++++++++--- 4 files changed, 59 insertions(+), 42 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index e6980bd060..c748a572ea 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11723,13 +11723,19 @@ information, including package dependencies. For maximum efficiency, it is recommended to install the @command{unzip} utility, so that the importer can unzip Python wheels and gather data from them. -The command below imports metadata for the @code{itsdangerous} Python -package: +The command below imports metadata for the latest version of the +@code{itsdangerous} Python package: @example guix import pypi itsdangerous @end example +You can also ask for a specific version: + +@example +guix import pypi itsdangerous@@1.1.0 +@end example + @table @code @item --recursive @itemx -r diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index f908136481..418a3556ec 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -128,27 +128,30 @@ missing-source-error? (package missing-source-error-package)) -(define (latest-source-release pypi-package) - "Return the latest source release for PYPI-PACKAGE." - (let ((releases (assoc-ref (pypi-project-releases pypi-package) - (project-info-version - (pypi-project-info pypi-package))))) +(define (latest-version project) + "Return the latest version of PROJECT, a record." + (project-info-version (pypi-project-info project))) + +(define* (source-release pypi-package + #:optional (version (latest-version pypi-package))) + "Return the source release of VERSION for PYPI-PACKAGE, a +record, by default the latest version." + (let ((releases (or (assoc-ref (pypi-project-releases pypi-package) version) + '()))) (or (find (lambda (release) (string=? "sdist" (distribution-package-type release))) releases) (raise (condition (&missing-source-error (package pypi-package))))))) -(define (latest-wheel-release pypi-package) +(define* (wheel-release pypi-package + #:optional (version (latest-version pypi-package))) "Return the url of the wheel for the latest release of pypi-package, or #f if there isn't any." - (let ((releases (assoc-ref (pypi-project-releases pypi-package) - (project-info-version - (pypi-project-info pypi-package))))) - (or (find (lambda (release) - (string=? "bdist_wheel" (distribution-package-type release))) - releases) - #f))) + (let ((releases (assoc-ref (pypi-project-releases pypi-package) version))) + (find (lambda (release) + (string=? "bdist_wheel" (distribution-package-type release))) + releases))) (define (python->package-name name) "Given the NAME of a package on PyPI, return a Guix-compliant name for the @@ -484,18 +487,17 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." "Fetch the metadata for PACKAGE-NAME from pypi.org, and return the `package' s-expression corresponding to that package, or #f on failure." (let* ((project (pypi-fetch package-name)) - (info (and project (pypi-project-info project)))) + (info (and=> project pypi-project-info)) + (version (or version (and=> project latest-version)))) (and project (guard (c ((missing-source-error? c) (let ((package (missing-source-error-package c))) (leave (G_ "no source release for pypi package ~a ~a~%") - (project-info-name info) - (project-info-version info))))) - (make-pypi-sexp (project-info-name info) - (project-info-version info) - (and=> (latest-source-release project) + (project-info-name info) version)))) + (make-pypi-sexp (project-info-name info) version + (and=> (source-release project version) distribution-url) - (and=> (latest-wheel-release project) + (and=> (wheel-release project version) distribution-url) (project-info-home-page info) (project-info-summary info) @@ -503,8 +505,9 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." (string->license (project-info-license info))))))))) -(define (pypi-recursive-import package-name) +(define* (pypi-recursive-import package-name #:optional version) (recursive-import package-name + #:version version #:repo->guix-package pypi->guix-package #:guix-name python->package-name)) @@ -538,7 +541,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." (let* ((info (pypi-project-info pypi-package)) (version (project-info-version info)) (url (distribution-url - (latest-source-release pypi-package)))) + (source-release pypi-package)))) (upstream-source (urls (list url)) (input-changes diff --git a/guix/scripts/import/pypi.scm b/guix/scripts/import/pypi.scm index 9170a0b359..a52cd95c93 100644 --- a/guix/scripts/import/pypi.scm +++ b/guix/scripts/import/pypi.scm @@ -27,6 +27,7 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-11) #:use-module (srfi srfi-37) + #:use-module (srfi srfi-71) #:use-module (ice-9 match) #:use-module (ice-9 format) #:export (guix-import-pypi)) @@ -83,21 +84,22 @@ Import and convert the PyPI package for PACKAGE-NAME.\n")) (_ #f)) (reverse opts)))) (match args - ((package-name) - (if (assoc-ref opts 'recursive) - ;; Recursive import - (map (match-lambda - ((and ('package ('name name) . rest) pkg) - `(define-public ,(string->symbol name) - ,pkg)) - (_ #f)) - (pypi-recursive-import package-name)) - ;; Single import - (let ((sexp (pypi->guix-package package-name))) - (unless sexp - (leave (G_ "failed to download meta-data for package '~a'~%") - package-name)) - sexp))) + ((spec) + (let ((name version (package-name->name+version spec))) + (if (assoc-ref opts 'recursive) + ;; Recursive import + (map (match-lambda + ((and ('package ('name name) . rest) pkg) + `(define-public ,(string->symbol name) + ,pkg)) + (_ #f)) + (pypi-recursive-import name version)) + ;; Single import + (let ((sexp (pypi->guix-package name #:version version))) + (unless sexp + (leave (G_ "failed to download meta-data for package '~a'~%") + name)) + sexp)))) (() (leave (G_ "too few arguments~%"))) ((many ...) diff --git a/tests/pypi.scm b/tests/pypi.scm index 70f4298a90..ad869ac31f 100644 --- a/tests/pypi.scm +++ b/tests/pypi.scm @@ -260,9 +260,15 @@ Requires-Dist: pytest (>=3.1.0); extra == 'testing' ('synopsis "summary") ('description "summary") ('license 'license:lgpl2.0)) - (string=? (bytevector->nix-base32-string - test-source-hash) - hash)) + (and (string=? (bytevector->nix-base32-string + test-source-hash) + hash) + (equal? (pypi->guix-package "foo" #:version "1.0.0") + (pypi->guix-package "foo")) + (catch 'quit + (lambda () + (pypi->guix-package "foo" #:version "42")) + (const #t)))) (x (pk 'fail x #f)))))) -- cgit v1.2.3 From 450e1dd52e0a34bb00fcb655956e40d69d50a331 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 29 Oct 2021 21:26:16 +0200 Subject: import: cran: Allow imports of a specific version. * guix/import/cran.scm (download): Handle the case where URL is a list. (fetch-description-from-tarball): New procedure. (fetch-description): Add #:version parameter. Honor it when REPOSITORY is 'cran. Use 'fetch-description-from-tarball' when REPOSITORY is 'bioconductor. (description->package): SOURCE-URL may now be a list. (cran->guix-package): Pass VERSION to 'fetch-description'. (cran-recursive-import): Add #:version parameter. * guix/scripts/import/cran.scm (guix-import-cran): Expect a spec rather than a mere package name. * doc/guix.texi (Invoking guix import): Document it. --- doc/guix.texi | 6 +++ guix/import/cran.scm | 91 ++++++++++++++++++++++++++++---------------- guix/scripts/import/cran.scm | 35 +++++++++-------- 3 files changed, 84 insertions(+), 48 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index c748a572ea..29a6665540 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11833,6 +11833,12 @@ The command command below imports metadata for the Cairo R package: guix import cran Cairo @end example +You can also ask for a specific version: + +@example +guix import cran rasterVis@@0.50.3 +@end example + When @option{--recursive} is added, the importer will traverse the dependency graph of the given upstream package recursively and generate package expressions for all those packages that are not yet in Guix. diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 07a5656cf1..7478866515 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -229,26 +229,61 @@ bioconductor package NAME, or #F if the package is unknown." (let ((store-directory (add-to-store store (basename url) #t "sha256" dir))) (values store-directory changeset))))))) - (else (download-to-store store url))))))) - -(define (fetch-description repository name) + (else + (match url + ((? string?) + (download-to-store store url)) + ((urls ...) + ;; Try all the URLs. A use case where this is useful is when one + ;; of the URLs is the /Archive CRAN URL. + (any (cut download-to-store store <>) urls))))))))) + +(define (fetch-description-from-tarball url) + "Fetch the tarball at URL, extra its 'DESCRIPTION' file, parse it, and +return the resulting alist." + (match (download url) + (#f #f) + (tarball + (call-with-temporary-directory + (lambda (dir) + (parameterize ((current-error-port (%make-void-port "rw+")) + (current-output-port (%make-void-port "rw+"))) + (and (zero? (system* "tar" "--wildcards" "-x" + "--strip-components=1" + "-C" dir + "-f" tarball "*/DESCRIPTION")) + (description->alist + (call-with-input-file (string-append dir "/DESCRIPTION") + read-string))))))))) + +(define* (fetch-description repository name #:optional version) "Return an alist of the contents of the DESCRIPTION file for the R package -NAME in the given REPOSITORY, or #f in case of failure. NAME is +NAME at VERSION in the given REPOSITORY, or #f in case of failure. NAME is case-sensitive." (case repository ((cran) - (let ((url (string-append %cran-url name "/DESCRIPTION"))) - (guard (c ((http-get-error? c) - (warning (G_ "failed to retrieve package information \ + (guard (c ((http-get-error? c) + (warning (G_ "failed to retrieve package information \ from ~a: ~a (~a)~%") - (uri->string (http-get-error-uri c)) - (http-get-error-code c) - (http-get-error-reason c)) - #f)) - (let* ((port (http-fetch url)) - (result (description->alist (read-string port)))) - (close-port port) - result)))) + (uri->string (http-get-error-uri c)) + (http-get-error-code c) + (http-get-error-reason c)) + #f)) + ;; When VERSION is true, we have to download the tarball to get at its + ;; 'DESCRIPTION' file; only the latest one is directly accessible over + ;; HTTP. + (if version + (let ((urls (list (string-append "mirror://cran/src/contrib/" + name "_" version ".tar.gz") + (string-append "mirror://cran/src/contrib/Archive/" + name "/" + name "_" version ".tar.gz")))) + (fetch-description-from-tarball urls)) + (let* ((url (string-append %cran-url name "/DESCRIPTION")) + (port (http-fetch url)) + (result (description->alist (read-string port)))) + (close-port port) + result)))) ((bioconductor) ;; Currently, the bioconductor project does not offer a way to access a ;; package's DESCRIPTION file over HTTP, so we determine the version, @@ -257,22 +292,13 @@ from ~a: ~a (~a)~%") (and (latest-bioconductor-package-version name) #t) (and (latest-bioconductor-package-version name 'annotation) 'annotation) (and (latest-bioconductor-package-version name 'experiment) 'experiment))) + ;; TODO: Honor VERSION. (version (latest-bioconductor-package-version name type)) (url (car (bioconductor-uri name version type))) - (tarball (download url))) - (call-with-temporary-directory - (lambda (dir) - (parameterize ((current-error-port (%make-void-port "rw+")) - (current-output-port (%make-void-port "rw+"))) - (and (zero? (system* "tar" "--wildcards" "-x" - "--strip-components=1" - "-C" dir - "-f" tarball "*/DESCRIPTION")) - (and=> (description->alist (with-input-from-file - (string-append dir "/DESCRIPTION") read-string)) - (lambda (meta) - (if (boolean? type) meta - (cons `(bioconductor-type . ,type) meta)))))))))) + (meta (fetch-description-from-tarball url))) + (if (boolean? type) + meta + (cons `(bioconductor-type . ,type) meta)))) ((git) (and (string-prefix? "http" name) ;; Download the git repository at "NAME" @@ -485,7 +511,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." ((bioconductor) (list (assoc-ref meta 'bioconductor-type))) (else '()))) - ((url rest ...) url) + ((urls ...) urls) ((? string? url) url) (_ #f))))) (git? (assoc-ref meta 'git)) @@ -592,7 +618,7 @@ from the alist META, which was derived from the R package's DESCRIPTION file." (lambda* (package-name #:key (repo 'cran) version) "Fetch the metadata for PACKAGE-NAME from REPO and return the `package' s-expression corresponding to that package, or #f on failure." - (let ((description (fetch-description repo package-name))) + (let ((description (fetch-description repo package-name version))) (if description (description->package repo description) (case repo @@ -610,8 +636,9 @@ s-expression corresponding to that package, or #f on failure." (&message (message "couldn't find meta-data for R package"))))))))))) -(define* (cran-recursive-import package-name #:key (repo 'cran)) +(define* (cran-recursive-import package-name #:key (repo 'cran) version) (recursive-import package-name + #:version version #:repo repo #:repo->guix-package cran->guix-package #:guix-name cran-guix-name)) diff --git a/guix/scripts/import/cran.scm b/guix/scripts/import/cran.scm index 3e4b038cc4..2934d4300a 100644 --- a/guix/scripts/import/cran.scm +++ b/guix/scripts/import/cran.scm @@ -27,8 +27,8 @@ #:use-module (guix import utils) #:use-module (guix scripts import) #:use-module (srfi srfi-1) - #:use-module (srfi srfi-11) #:use-module (srfi srfi-37) + #:use-module (srfi srfi-71) #:use-module (ice-9 match) #:use-module (ice-9 format) #:export (guix-import-cran)) @@ -98,21 +98,24 @@ Import and convert the CRAN package for PACKAGE-NAME.\n")) (reverse opts)))) (parameterize ((%input-style (assoc-ref opts 'style))) (match args - ((package-name) - (if (assoc-ref opts 'recursive) - ;; Recursive import - (with-error-handling - (map package->definition - (filter identity - (cran-recursive-import package-name - #:repo (or (assoc-ref opts 'repo) 'cran))))) - ;; Single import - (let ((sexp (cran->guix-package package-name - #:repo (or (assoc-ref opts 'repo) 'cran)))) - (unless sexp - (leave (G_ "failed to download description for package '~a'~%") - package-name)) - sexp))) + ((spec) + (let ((name version (package-name->name+version spec))) + (if (assoc-ref opts 'recursive) + ;; Recursive import + (with-error-handling + (map package->definition + (filter identity + (cran-recursive-import name + #:version version + #:repo (or (assoc-ref opts 'repo) 'cran))))) + ;; Single import + (let ((sexp (cran->guix-package name + #:version version + #:repo (or (assoc-ref opts 'repo) 'cran)))) + (unless sexp + (leave (G_ "failed to download description for package '~a'~%") + name)) + sexp)))) (() (leave (G_ "too few arguments~%"))) ((many ...) -- cgit v1.2.3 From f634a0baab85454a6feac25e29905f564b276c9e Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 2 Nov 2021 20:06:32 +0100 Subject: services: Add qemu-guest-agent service. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services/virtualization.scm (): New record. (qemu-guest-agent-shepherd-service): New procedure. (qemu-guest-agent-service-type): New variable. * doc/guix.texi (Virtualization Services): Document it. Signed-off-by: Ludovic Courtès --- doc/guix.texi | 47 ++++++++++++++++++++++++++++++++++++++++ gnu/services/virtualization.scm | 48 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 1 deletion(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 29a6665540..7e54b5f75e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -30060,6 +30060,53 @@ Return the name of @var{platform}---a string such as @code{"arm"}. @end deffn +@subsubheading QEMU Guest Agent + +@cindex emulation + +The QEMU guest agent provides control over the emulated system to the +host. The @code{qemu-guest-agent} service runs the agent on Guix +guests. To control the agent from the host, open a socket by invoking +QEMU with the following arguments: + +@example +qemu-system-x86_64 \ + -chardev socket,path=/tmp/qga.sock,server=on,wait=off,id=qga0 \ + -device virtio-serial \ + -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ + ... +@end example + +This creates a socket at @file{/tmp/qga.sock} on the host. Once the +guest agent is running, you can issue commands with @code{socat}: + +@example +$ guix shell socat -- socat unix-connect:/tmp/qga.sock stdio +@{"execute": "guest-get-host-name"@} +@{"return": @{"host-name": "guix"@}@} +@end example + +See @url{https://wiki.qemu.org/Features/GuestAgent,QEMU guest agent +documentation} for more options and commands. + +@defvr {Scheme Variable} qemu-guest-agent-service-type +Service type for the QEMU guest agent service. +@end defvr + +@deftp {Data Type} qemu-guest-agent-configuration +Configuration for the @code{qemu-guest-agent} service. + +@table @asis +@item @code{qemu} (default: @code{qemu-minimal}) +The QEMU package to use. + +@item @code{device} (default: @code{""}) +File name of the device or socket the agent uses to communicate with the +host. If empty, QEMU uses a default file name. +@end table +@end deftp + + @subsubheading The Hurd in a Virtual Machine @cindex @code{hurd} diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index bca5f56b87..1a5744ffbf 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2017 Ryan Moe ;;; Copyright © 2018, 2020, 2021 Ludovic Courtès ;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2021 Timotej Lazar ;;; ;;; This file is part of GNU Guix. ;;; @@ -82,7 +83,11 @@ qemu-binfmt-configuration qemu-binfmt-configuration? - qemu-binfmt-service-type)) + qemu-binfmt-service-type + + qemu-guest-agent-configuration + qemu-guest-agent-configuration? + qemu-guest-agent-service-type)) (define (uglify-field-name field-name) (let ((str (symbol->string field-name))) @@ -847,6 +852,47 @@ given QEMU package." compiled for other architectures using QEMU and the @code{binfmt_misc} functionality of the kernel Linux."))) + +;;; +;;; QEMU guest agent service. +;;; + +(define-configuration qemu-guest-agent-configuration + (qemu + (package qemu-minimal) + "QEMU package.") + (device + (string "") + "Path to device or socket used to communicate with the host. If not +specified, the QEMU default path is used.")) + +(define qemu-guest-agent-shepherd-service + (match-lambda + (($ qemu device) + (list + (shepherd-service + (provision '(qemu-guest-agent)) + (documentation "Run the QEMU guest agent.") + (start #~(make-forkexec-constructor + `(,(string-append #$qemu "/bin/qemu-ga") "--daemon" + "--pidfile=/var/run/qemu-ga.pid" + "--statedir=/var/run" + ,@(if #$device + (list (string-append "--path=" #$device)) + '())) + #:pid-file "/var/run/qemu-ga.pid" + #:log-file "/var/log/qemu-ga.log")) + (stop #~(make-kill-destructor))))))) + +(define qemu-guest-agent-service-type + (service-type + (name 'qemu-guest-agent) + (extensions + (list (service-extension shepherd-root-service-type + qemu-guest-agent-shepherd-service))) + (default-value (qemu-guest-agent-configuration)) + (description "Run the QEMU guest agent."))) + ;;; ;;; Secrets for guest VMs. -- cgit v1.2.3 From f2d345a7b6add35d6cc0e45f0f0b1d96d9474de0 Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Sun, 14 Nov 2021 19:31:50 +0100 Subject: doc: Fix guix shell -C example. The meaning changed by accident when guix environment was replaced by guix shell in 80edb7df6586464aa40e84e103f0045452de95db. * doc/guix.texi (Debugging Build Failures): Add missing -D option. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 7e54b5f75e..a5f38e166b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -11464,7 +11464,7 @@ a container similar to the one the build daemon creates: $ guix build -K foo @dots{} $ cd /tmp/guix-build-foo.drv-0 -$ guix shell --no-grafts -C foo strace gdb +$ guix shell --no-grafts -C -D foo strace gdb [env]# source ./environment-variables [env]# cd foo-1.2 @end example -- cgit v1.2.3 From a8b5b40f62e8907b0e82c5088a8fb647d05a7737 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Mon, 8 Nov 2021 12:22:04 +0300 Subject: doc: Add a note about elogind and XDG_RUNTIME_DIR for Guix Home. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (Declaring the Home Environment): Add a note about elogind and XDG_RUNTIME_DIR. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index a5f38e166b..1b10e2d626 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -35975,6 +35975,14 @@ guix home reconfigure config.scm This ``builds'' your home environment and creates @file{~/.guix-home} pointing to it. Voilà! +@quotation Note +Make sure the operating system has elogind, systemd, or a similar +mechanism to create the XDG run-time directory and has the +@env{XDG_RUNTIME_DIR} variable set. Failing that, the +@file{on-first-login} script will not execute anything, and processes +like user Shepherd and its descendants will not start. +@end quotation + @node Configuring the Shell @section Configuring the Shell This section is safe to skip if your shell or shells are managed by -- cgit v1.2.3 From 21332f3b8cb8f407a89cdfe7d0460a9947675872 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 15 Nov 2021 17:23:08 +0100 Subject: gnu: hpcguix-web: Update to 0.2.0. * gnu/packages/web.scm (hpcguix-web): Update to 0.2.0. [arguments]: In 'wrap-program' phase, add guile-zlib to DEPS. [native-inputs]: Add GUILE. [inputs]: Add GUILE-ZLIB, GUILE-COMMONMARK, and GUILE-JSON. [propagated-inputs]: Remove. These were pointless. * gnu/services/web.scm ()[address, port]: New fields. * doc/guix.texi (Web Services): Document them. * gnu/tests/web.scm (%hpcguix-web-os): Add 'address'. --- doc/guix.texi | 6 ++++++ gnu/packages/web.scm | 17 +++++++++-------- gnu/services/web.scm | 10 +++++++++- gnu/tests/web.scm | 5 +++-- 4 files changed, 27 insertions(+), 11 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index 1b10e2d626..ea0c51d11a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -26552,6 +26552,12 @@ complete example}. @item @code{package} (default: @code{hpcguix-web}) The hpcguix-web package to use. + +@item @code{address} (default: @code{"127.0.0.1"}) +The IP address to listen to. + +@item @code{port} (default: @code{5000}) +The port number to listen to. @end table @end deftp diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index a4c47f92d8..9cdbc31459 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -7668,7 +7668,7 @@ compressed JSON header blocks. (define-public hpcguix-web (package (name "hpcguix-web") - (version "0.1.0") + (version "0.2.0") (source (origin (method git-fetch) (uri (git-reference @@ -7677,7 +7677,7 @@ compressed JSON header blocks. (file-name (git-file-name name version)) (sha256 (base32 - "02lz5k1hhkwfz3nr3lsd69icsz6n0q82z047d3svi09qpxw6y0cj")))) + "1l856d1vr63ns1sp9fm6v97p71mx00769k6lwzqzppsb9clksnwp")))) (build-system gnu-build-system) (arguments `(#:modules ((guix build gnu-build-system) @@ -7701,9 +7701,10 @@ compressed JSON header blocks. (git (assoc-ref inputs "guile-git")) (bs (assoc-ref inputs "guile-bytestructures")) (json (assoc-ref inputs "guile-json")) + (zlib (assoc-ref inputs "guile-zlib")) (guile-cm (assoc-ref inputs "guile-commonmark")) - (deps (list guile gcrypt git bs guile-cm guix json)) + (deps (list guile gcrypt git bs zlib guile-cm guix json)) (effective (read-line (open-pipe* OPEN_READ @@ -7728,15 +7729,15 @@ compressed JSON header blocks. `(("autoconf" ,autoconf) ("automake" ,automake) ("uglify-js" ,uglify-js) - ("pkg-config" ,pkg-config))) + ("pkg-config" ,pkg-config) + ("guile" ,@(assoc-ref (package-native-inputs guix) "guile")))) (inputs `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile")) ("guix" ,guix) - ("bash-minimal" ,bash-minimal))) ;for 'wrap-program' - (propagated-inputs - `(("guile" ,@(assoc-ref (package-native-inputs guix) "guile")) + ("guile-zlib" ,guile-zlib) ("guile-commonmark" ,guile-commonmark) - ("guile-json" ,guile-json-4))) + ("guile-json" ,guile-json-4) + ("bash-minimal" ,bash-minimal))) (home-page "https://github.com/UMCUGenetics/hpcguix-web") (synopsis "Web interface for cluster deployments of Guix") (description "Hpcguix-web provides a web interface to the list of packages diff --git a/gnu/services/web.scm b/gnu/services/web.scm index bb42eacf83..f1c3a2f75e 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -1110,7 +1110,9 @@ a webserver.") (package hpcguix-web-package (default hpcguix-web)) ; ;; Specs is gexp of hpcguix-web configuration file - (specs hpcguix-web-configuration-specs)) + (specs hpcguix-web-configuration-specs) + (address hpcguix-web-configuration-address (default "127.0.0.1")) + (port hpcguix-web-configuration-port (default 5000))) (define %hpcguix-web-accounts (list (user-group @@ -1163,6 +1165,12 @@ a webserver.") (requirement '(networking)) (start #~(make-forkexec-constructor (list #$(file-append hpcguix-web "/bin/hpcguix-web") + (string-append "--listen=" + #$(hpcguix-web-configuration-address + config)) + "-p" + #$(number->string + (hpcguix-web-configuration-port config)) (string-append "--config=" #$(scheme-file "hpcguix-web.scm" specs))) #:user "hpcguix-web" diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 518c9c1ff3..ccb2f53137 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2020 Ludovic Courtès +;;; Copyright © 2017, 2020-2021 Ludovic Courtès ;;; Copyright © 2017, 2019 Christopher Baines ;;; Copyright © 2017, 2018 Clément Lassieur ;;; Copyright © 2018 Pierre-Antoine Rouby @@ -438,7 +438,8 @@ HTTP-PORT, along with php-fpm." (service dhcp-client-service-type) (service hpcguix-web-service-type (hpcguix-web-configuration - (specs %hpcguix-web-specs))))) + (specs %hpcguix-web-specs) + (address "0.0.0.0"))))) (define %test-hpcguix-web (system-test -- cgit v1.2.3 From 58649b87470b3eaaa3c7f28656e125ae087b3186 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 14 Nov 2021 03:05:34 +0100 Subject: doc: Remove obsolete example module import. This follows up on commit a247f5c7537df7e0c09051ba22d5c95eb08f48b9. * doc/guix.texi (X Window): Remove unused (srfi srfi-1) from the modify-services example. --- doc/guix.texi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index ea0c51d11a..debdb166e4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -18651,8 +18651,7 @@ and tty8. @lisp (use-modules (gnu services) (gnu services desktop) - (gnu services xorg) - (srfi srfi-1)) ;for 'remove' + (gnu services xorg)) (operating-system ;; ... -- cgit v1.2.3 From 122396075f12b013b6bde56dafb895587b95bc9d Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 16 Nov 2021 01:04:54 +0100 Subject: services: cups: Update default timeouts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream raised these back in 2019 with CUPS 2.3.0. * gnu/services/cups.scm (): Raise default ‘multiple-operation-timeout’ and ‘timeout’ from 300 to 900 seconds. * doc/guix.texi (Printing Services): Adjust accordingly. --- doc/guix.texi | 4 ++-- gnu/services/cups.scm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'doc/guix.texi') diff --git a/doc/guix.texi b/doc/guix.texi index debdb166e4..8fdeb9328d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19540,7 +19540,7 @@ Defaults to @samp{1048576}. Specifies the maximum amount of time to allow between files in a multiple file print job, in seconds. -Defaults to @samp{300}. +Defaults to @samp{900}. @end deftypevr @deftypevr {@code{cups-configuration} parameter} string page-log-format @@ -19751,7 +19751,7 @@ Defaults to @samp{#f}. @deftypevr {@code{cups-configuration} parameter} non-negative-integer timeout Specifies the HTTP request timeout, in seconds. -Defaults to @samp{300}. +Defaults to @samp{900}. @end deftypevr diff --git a/gnu/services/cups.scm b/gnu/services/cups.scm index 8bcb450ddf..1b8e19bed8 100644 --- a/gnu/services/cups.scm +++ b/gnu/services/cups.scm @@ -702,7 +702,7 @@ in seconds. Set to 0 to disable cancellation of \"stuck\" jobs.") "Specifies the maximum size of the log files before they are rotated, in bytes. The value 0 disables log rotation.") (multiple-operation-timeout - (non-negative-integer 300) + (non-negative-integer 900) "Specifies the maximum amount of time to allow between files in a multiple file print job, in seconds.") (page-log-format @@ -847,7 +847,7 @@ protocol version to TLS v1.1.") "Specifies whether the scheduler requires clients to strictly adhere to the IPP specifications.") (timeout - (non-negative-integer 300) + (non-negative-integer 900) "Specifies the HTTP request timeout, in seconds.") (web-interface? (boolean #f) -- cgit v1.2.3