services: hpcguix-web: Provide default values.

* gnu/services/web.scm (<hpcguix-web-configuration>)[specs]: Default to #f.
(hpcguix-web-shepherd-service): Do not pass '--config' when SPECS is #f.
(hpcguix-web-service-type)[default-value]: New field.
* doc/guix.texi (Web Services): Adjust accordingly.
This commit is contained in:
Ludovic Courtès 2023-01-22 18:06:13 +01:00
parent e1dbac04c3
commit 6ffeef92e6
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 13 additions and 10 deletions

View file

@ -30320,10 +30320,10 @@ The service type for @code{hpcguix-web}.
Data type for the hpcguix-web service configuration. Data type for the hpcguix-web service configuration.
@table @asis @table @asis
@item @code{specs} @item @code{specs} (default: @code{#f})
A gexp (@pxref{G-Expressions}) specifying the hpcguix-web service Either @code{#f} or a gexp (@pxref{G-Expressions}) specifying the
configuration as an @code{hpcguix-web-configuration} record. The main hpcguix-web service configuration as an @code{hpcguix-web-configuration}
fields of that record type are: record. The main fields of that record type are:
@table @asis @table @asis
@item @code{title-prefix} (default: @code{"hpcguix | "}) @item @code{title-prefix} (default: @code{"hpcguix | "})

View file

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org> ;;; Copyright © 2015 David Thompson <davet@gnu.org>
;;; Copyright © 2015-2022 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2015-2023 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Nikita <nikita@n0.is> ;;; Copyright © 2016 Nikita <nikita@n0.is>
;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2017, 2018, 2019 Christopher Baines <mail@cbaines.net> ;;; Copyright © 2017, 2018, 2019 Christopher Baines <mail@cbaines.net>
@ -1155,8 +1155,7 @@ (define-record-type* <hpcguix-web-configuration>
(package hpcguix-web-package (default hpcguix-web)) ;file-like (package hpcguix-web-package (default hpcguix-web)) ;file-like
;; Specs is gexp of hpcguix-web configuration file (specs hpcguix-web-configuration-specs (default #f)) ;#f | gexp
(specs hpcguix-web-configuration-specs)
(address hpcguix-web-configuration-address (default "127.0.0.1")) (address hpcguix-web-configuration-address (default "127.0.0.1"))
(port hpcguix-web-configuration-port (default 5000))) (port hpcguix-web-configuration-port (default 5000)))
@ -1217,8 +1216,11 @@ (define (hpcguix-web-shepherd-service config)
"-p" "-p"
#$(number->string #$(number->string
(hpcguix-web-configuration-port config)) (hpcguix-web-configuration-port config))
(string-append "--config=" #$@(if specs
#$(scheme-file "hpcguix-web.scm" specs))) #~((string-append "--config="
#$(scheme-file
"hpcguix-web.scm" specs)))
#~()))
#:user "hpcguix-web" #:user "hpcguix-web"
#:group "hpcguix-web" #:group "hpcguix-web"
#:environment-variables #:environment-variables
@ -1239,7 +1241,8 @@ (define hpcguix-web-service-type
(service-extension rottlog-service-type (service-extension rottlog-service-type
(const %hpcguix-web-log-rotations)) (const %hpcguix-web-log-rotations))
(service-extension shepherd-root-service-type (service-extension shepherd-root-service-type
(compose list hpcguix-web-shepherd-service)))))) (compose list hpcguix-web-shepherd-service))))
(default-value (hpcguix-web-configuration))))
;;; ;;;