diff --git a/etc/manifests/cross-compile.scm b/etc/manifests/cross-compile.scm index 44a6407b0c3..776da581cf9 100644 --- a/etc/manifests/cross-compile.scm +++ b/etc/manifests/cross-compile.scm @@ -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: diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index b32a960bcf6..25f44566beb 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -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: - ;; . - xf86-input-libinput - xf86-input-evdev - xf86-input-mouse)) + ;; Libinput is the new thing and is recommended over evdev/synaptics: + ;; . + 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.