[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: services: hpcguix-web: Provide default values.
From: |
guix-commits |
Subject: |
02/02: services: hpcguix-web: Provide default values. |
Date: |
Sun, 22 Jan 2023 12:14:56 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 6ffeef92e64f0f296dd795db906a480dbd3e97a4
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Jan 22 18:06:13 2023 +0100
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.
---
doc/guix.texi | 8 ++++----
gnu/services/web.scm | 15 +++++++++------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 507a0d3ee4..e4474943b9 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -30320,10 +30320,10 @@ The service type for @code{hpcguix-web}.
Data type for the hpcguix-web service configuration.
@table @asis
-@item @code{specs}
-A gexp (@pxref{G-Expressions}) specifying the hpcguix-web service
-configuration as an @code{hpcguix-web-configuration} record. The main
-fields of that record type are:
+@item @code{specs} (default: @code{#f})
+Either @code{#f} or a gexp (@pxref{G-Expressions}) specifying the
+hpcguix-web service configuration as an @code{hpcguix-web-configuration}
+record. The main fields of that record type are:
@table @asis
@item @code{title-prefix} (default: @code{"hpcguix | "})
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 83aa97055f..d56e893527 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; 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, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2017, 2018, 2019 Christopher Baines <mail@cbaines.net>
@@ -1155,8 +1155,7 @@ a webserver.")
(package hpcguix-web-package (default hpcguix-web)) ;file-like
- ;; Specs is gexp of hpcguix-web configuration file
- (specs hpcguix-web-configuration-specs)
+ (specs hpcguix-web-configuration-specs (default #f)) ;#f | gexp
(address hpcguix-web-configuration-address (default "127.0.0.1"))
(port hpcguix-web-configuration-port (default 5000)))
@@ -1217,8 +1216,11 @@ a webserver.")
"-p"
#$(number->string
(hpcguix-web-configuration-port config))
- (string-append "--config="
- #$(scheme-file "hpcguix-web.scm" specs)))
+ #$@(if specs
+ #~((string-append "--config="
+ #$(scheme-file
+ "hpcguix-web.scm" specs)))
+ #~()))
#:user "hpcguix-web"
#:group "hpcguix-web"
#:environment-variables
@@ -1239,7 +1241,8 @@ a webserver.")
(service-extension rottlog-service-type
(const %hpcguix-web-log-rotations))
(service-extension shepherd-root-service-type
- (compose list hpcguix-web-shepherd-service))))))
+ (compose list hpcguix-web-shepherd-service))))
+ (default-value (hpcguix-web-configuration))))
;;;