installer: tests: Use a filter to select desktop-environments.

* gnu/installer/tests.scm (choose-services): Turn desktop-environments list
into a choose-desktop-environment procedure. This way, it is easier to select
all desktop-environments or none, in the same way as choose-network-service?
and choose-network-management-tool? arguments.
This commit is contained in:
Mathieu Othacehe 2020-03-24 09:21:02 +01:00
parent 62c27e09f0
commit 7a1a10dbd4
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -211,7 +212,7 @@ (define* (enter-host-name+passwords port
(define* (choose-services port
#:key
(desktop-environments '("GNOME"))
(choose-desktop-environment? (const #f))
(choose-network-service?
(lambda (service)
(or (string-contains service "SSH")
@ -220,10 +221,14 @@ (define* (choose-services port
(lambda (service)
(string-contains service "DHCP"))))
"Converse over PORT to choose networking services."
(define desktop-environments '())
(converse port
((checkbox-list (title "Desktop environment") (text _)
(items _))
desktop-environments)
(items ,services))
(let ((desktops (filter choose-desktop-environment? services)))
(set! desktop-environments desktops)
desktops))
((checkbox-list (title "Network service") (text _)
(items ,services))
(filter choose-network-service? services))