services: xorg: Filter modules based on system

Fixes <https://bugs.gnu.org/39402>.
Reported by shtwzrd <shtwzrd@protonmail.com>.

* gnu/services/xorg.scm (xorg-configuration):
  Apply a filter over %default-xorg-modules packages, excluding
  those for which the %current-system is not among the package's
  supported-systems.

This patch makes it possible to use xorg-configuration on systems
other than x86_64 and i686, as without it, xf86-video-intel would
be pulled in on the unsupported architecture and fail.

Signed-off-by: Jakub Kądziołka <kuba@kadziolka.net>
This commit is contained in:
shtwzrd 2020-02-09 21:31:09 +00:00 committed by Jakub Kądziołka
parent c66f3b3bec
commit 779d96c9b0
No known key found for this signature in database
GPG key ID: E315A75846131564

View file

@ -5,6 +5,7 @@
;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
;;; Copyright © 2020 shtwzrd <shtwzrd@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@ -152,7 +153,12 @@ (define-record-type* <xorg-configuration>
xorg-configuration make-xorg-configuration
xorg-configuration?
(modules xorg-configuration-modules ;list of packages
(default %default-xorg-modules))
; filter out modules not supported on current system
(default (filter
(lambda (p)
(member (%current-system)
(package-supported-systems p)))
%default-xorg-modules)))
(fonts xorg-configuration-fonts ;list of packges
(default %default-xorg-fonts))
(drivers xorg-configuration-drivers ;list of strings