aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/web.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-01-22 18:06:13 +0100
committerLudovic Courtès <ludo@gnu.org>2023-01-22 18:12:09 +0100
commit6ffeef92e64f0f296dd795db906a480dbd3e97a4 (patch)
tree7766c56aa3fcc6d5ee12a5ecfbcbe6d6df54a27b /gnu/services/web.scm
parente1dbac04c3b89670ef726a0dafd390e87c6c754f (diff)
downloadguix-6ffeef92e64f0f296dd795db906a480dbd3e97a4.tar
guix-6ffeef92e64f0f296dd795db906a480dbd3e97a4.tar.gz
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.
Diffstat (limited to 'gnu/services/web.scm')
-rw-r--r--gnu/services/web.scm15
1 files changed, 9 insertions, 6 deletions
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))))
;;;