services: xorg: Return only supported packages in %default-xorg-modules.

The xorg modules are used inside of services that's thunked. So we can
make them depend on the %current-system.

* gnu/services/xorg.scm
(default-xorg-modules): New variable.
(%default-xorg-modules): Return result of (default-xorg-modules).

Change-Id: I10f722e52d598ce3e83ef3f200b3bd953bc08e17
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
This commit is contained in:
Rutherther 2025-12-22 09:10:41 +01:00
parent 0801604990
commit 9e7e40b8bd
No known key found for this signature in database
GPG key ID: 0322798269E471C3
2 changed files with 39 additions and 23 deletions

View file

@ -71,18 +71,21 @@ TARGET."
"connman" "network-manager" "wpa-supplicant" "isc-dhcp" "cups"
"linux-libre" "grub-hybrid")))
(define %system-gui-packages
(define (%system-gui-packages target)
;; Key packages proposed by the Guix System installer.
(append (map specification->package
'(;; build system `python' does not support cross builds
;"gnome" "xfce" "mate" "openbox"
;"gnome" "xfce" "mate" "openbox"
"awesome"
"i3-wm" "i3status" "dmenu" "st"
"ratpoison" "xterm"
;; build system `emacs' does not support cross builds
;"emacs-exwm" "emacs-desktop-environment"
;"emacs-exwm" "emacs-desktop-environment"
"emacs"))
%default-xorg-modules))
;; NOTE: %default-xorg-modules depends on system.
(parameterize
((%current-target-system target))
%default-xorg-modules)))
(define %packages-to-cross-build
;; Packages that must be cross-buildable from x86_64-linux.
@ -151,7 +154,8 @@ TARGET."
;; With a graphical environment:
(if (or (target-x86-32? target)
(target-aarch64? target))
%system-gui-packages
;; %system-gui-packages depends on the system.
(%system-gui-packages target)
'()))))
(fold delete (map platform-system->target (systems))
'(;; Disable cross-compilation to self:

View file

@ -64,6 +64,7 @@
#:use-module ((guix modules) #:select (source-module-closure))
#:use-module (guix packages)
#:use-module (guix derivations)
#:use-module (guix platform)
#:use-module (guix records)
#:use-module (guix deprecation)
#:use-module (guix utils)
@ -148,25 +149,36 @@
;;;
;;; Code:
(define %default-xorg-modules
;; Default list of modules loaded by the server. When multiple drivers
;; match, the first one in the list is loaded.
(list xf86-video-vesa
xf86-video-fbdev
xf86-video-amdgpu
xf86-video-ati
xf86-video-cirrus
xf86-video-intel
xf86-video-mach64
xf86-video-nouveau
xf86-video-nv
xf86-video-sis
(define* (default-xorg-modules
#:optional
(system (or (and=>
(%current-target-system)
platform-target->system)
(%current-system))))
"Default list of modules loaded by the server. When multiple drivers match,
the first one in the list is loaded."
;; Return only supported packages, because some aren't supported
;; on all architectures.
(filter (cut supported-package? <> system)
(list xf86-video-vesa
xf86-video-fbdev
xf86-video-amdgpu
xf86-video-ati
xf86-video-cirrus
xf86-video-intel
xf86-video-mach64
xf86-video-nouveau
xf86-video-nv
xf86-video-sis
;; Libinput is the new thing and is recommended over evdev/synaptics:
;; <http://who-t.blogspot.fr/2015/01/xf86-input-libinput-compatibility-with.html>.
xf86-input-libinput
xf86-input-evdev
xf86-input-mouse))
;; Libinput is the new thing and is recommended over evdev/synaptics:
;; <http://who-t.blogspot.fr/2015/01/xf86-input-libinput-compatibility-with.html>.
xf86-input-libinput
xf86-input-evdev
xf86-input-mouse)))
(define-syntax %default-xorg-modules
(identifier-syntax (default-xorg-modules)))
(define %default-xorg-fonts
;; Default list of fonts available to the X server.