services: configuration: Generalize 'list-of-packages?'

* gnu/services/configuration.scm (list-of-packages?): Allow as well
tuples of a package and its output.
* gnu/home/services/sway.scm (list-of-packages): Remove duplicate.

Change-Id: I42622a29ac808c76928e9056dee9330d5e1b3f39
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #5470
This commit is contained in:
Sergey Trofimov 2026-01-08 11:45:46 +01:00 committed by Ludovic Courtès
parent bb106f7b85
commit a651926f55
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 4 additions and 4 deletions

View file

@ -129,9 +129,6 @@
(define (list-of-string-ish? lst)
(every string-ish? lst))
(define (list-of-packages? lst)
(every package? lst))
(define (bar-position? p)
(member p '(top bottom)))

View file

@ -535,7 +535,10 @@ the list result in @code{#t} when applying PRED? on them."
#f)))
(define list-of-packages?
(list-of package?))
(list-of (match-lambda
((? package? pkg) #t)
(((? package? pkg) output) #t)
(_ #f))))
(define list-of-strings?
(list-of string?))