system, home: Validate ‘services’ field value.

This guides newcomers who might stick a single (service …) form
in this field.

* gnu/services.scm (validate-service-list): New macro.
(%validate-service-list): New procedure.
* gnu/system.scm (<operating-system>)[services]: Add ‘sanitize’.
* gnu/home.scm (<home-environment>)[services]: Add ‘sanitize’.

Change-Id: I9e29bd9a078e87b627ab766fd669ba9de79f8473
This commit is contained in:
Ludovic Courtès 2024-02-23 21:22:55 +01:00
parent b5018807ee
commit 29de2edfbb
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
3 changed files with 24 additions and 5 deletions

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2013-2022, 2024 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
@ -294,7 +294,8 @@ VERSION is the target version of the boot-parameters record."
this-operating-system)))
(services operating-system-user-services ; list of services
(thunked) ;allow for system-dependent services
(default %base-services))
(default %base-services)
(sanitize validate-service-list))
(pam-services operating-system-pam-services ; list of PAM services
(default (base-pam-services)))