summaryrefslogtreecommitdiff
path: root/gnu/services.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/services.scm')
-rw-r--r--gnu/services.scm19
1 files changed, 18 insertions, 1 deletions
diff --git a/gnu/services.scm b/gnu/services.scm
index 59481af10f3..88593e80913 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -1,5 +1,5 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015-2023 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2015-2024 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com> 3;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
4;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> 4;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
5;;; Copyright © 2020, 2021 Ricardo Wurmus <rekado@elephly.net> 5;;; Copyright © 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
@@ -91,6 +91,8 @@
91 for-home 91 for-home
92 for-home? 92 for-home?
93 93
94 validate-service-list
95
94 service-error? 96 service-error?
95 missing-value-service-error? 97 missing-value-service-error?
96 missing-value-service-error-type 98 missing-value-service-error-type
@@ -1271,4 +1273,19 @@ Home service rather than a System service."
1271 (syntax-parameterize ((for-home? (identifier-syntax #t))) 1273 (syntax-parameterize ((for-home? (identifier-syntax #t)))
1272 exp ...)) 1274 exp ...))
1273 1275
1276(define-with-syntax-properties (validate-service-list (value properties))
1277 (%validate-service-list value properties))
1278
1279(define (%validate-service-list value properties)
1280 (match value
1281 (((? service?) ...) value)
1282 (_
1283 (raise
1284 (make-compound-condition
1285 (condition
1286 (&error-location
1287 (location (source-properties->location properties))))
1288 (formatted-message
1289 (G_ "'services' field must contain a list of services")))))))
1290
1274;;; services.scm ends here. 1291;;; services.scm ends here.