From 779d96c9b0ee38cbaca9f8577e6cc7f907fb29cb Mon Sep 17 00:00:00 2001 From: shtwzrd Date: Sun, 9 Feb 2020 21:31:09 +0000 Subject: services: xorg: Filter modules based on system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes . Reported by shtwzrd . * 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 --- gnu/services/xorg.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gnu/services/xorg.scm') diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 73a32e4b02..df5c350a37 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2018, 2019 Timothy Sample ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2019 Tim Gesthuizen +;;; Copyright © 2020 shtwzrd ;;; ;;; This file is part of GNU Guix. ;;; @@ -152,7 +153,12 @@ (define-record-type* 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 -- cgit v1.2.3 From 50be0da7bfd5c108697679effeb2a893d2f37598 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sun, 16 Feb 2020 12:58:33 +0100 Subject: services: set-xorg-configuration: handle slim and sddm * gnu/services/xorg.scm (handle-xorg-configuration): New syntax. (gdm-service-type, slim-service-type): Use handle-xorg-configuration. * gnu/services/sddm.scm (sddm-service-type): Likewise. --- gnu/services/sddm.scm | 34 ++++++++-------- gnu/services/xorg.scm | 108 +++++++++++++++++++++++++++----------------------- 2 files changed, 77 insertions(+), 65 deletions(-) (limited to 'gnu/services/xorg.scm') diff --git a/gnu/services/sddm.scm b/gnu/services/sddm.scm index 473b4876a1..1921afce95 100644 --- a/gnu/services/sddm.scm +++ b/gnu/services/sddm.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2019 Ludovic Courtès ;;; Copyright © 2019 Jesse Gildersleve +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -306,22 +307,23 @@ (define sddm-profile-service (compose list sddm-configuration-sddm)) (define sddm-service-type - (service-type (name 'sddm) - (extensions - (list (service-extension shepherd-root-service-type - sddm-shepherd-service) - (service-extension etc-service-type - sddm-etc-service) - (service-extension pam-root-service-type - sddm-pam-services) - (service-extension account-service-type - (const %sddm-accounts)) - (service-extension profile-service-type - sddm-profile-service))) - (default-value (sddm-configuration)) - (description - "Run SDDM, a display and log-in manager for X11 and -Wayland."))) + (handle-xorg-configuration sddm-configuration + (service-type (name 'sddm) + (extensions + (list (service-extension shepherd-root-service-type + sddm-shepherd-service) + (service-extension etc-service-type + sddm-etc-service) + (service-extension pam-root-service-type + sddm-pam-services) + (service-extension account-service-type + (const %sddm-accounts)) + (service-extension profile-service-type + sddm-profile-service))) + (default-value (sddm-configuration)) + (description + "Run SDDM, a display and log-in manager for X11 and +Wayland.")))) (define-deprecated (sddm-service #:optional (config (sddm-configuration))) sddm-service-type diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index df5c350a37..09379d40c3 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2019 Tim Gesthuizen ;;; Copyright © 2020 shtwzrd +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -103,6 +104,8 @@ (define-module (gnu services xorg) gdm-configuration gdm-service-type gdm-service + + handle-xorg-configuration set-xorg-configuration)) ;;; Commentary: @@ -459,6 +462,25 @@ (define (find-session profile) (program-file "xinitrc" builder)) +(define-syntax handle-xorg-configuration + (syntax-rules () + "Generate the `compose' and `extend' entries of a login manager +`service-type' to handle specifying the `xorg-configuration' through +a `service-extension', as used by `set-xorg-configuration'." + ((_ configuration-record service-type-definition) + (service-type + (inherit service-type-definition) + (compose (lambda (extensions) + (match extensions + (() #f) + ((config . _) config)))) + (extend (lambda (config xorg-configuration) + (if xorg-configuration + (configuration-record + (inherit config) + (xorg-configuration xorg-configuration)) + config))))))) + ;;; ;;; SLiM log-in manager. @@ -584,18 +606,20 @@ (define theme (respawn? #t))))) (define slim-service-type - (service-type (name 'slim) - (extensions - (list (service-extension shepherd-root-service-type - slim-shepherd-service) - (service-extension pam-root-service-type - slim-pam-service) + (handle-xorg-configuration slim-configuration + (service-type (name 'slim) + (extensions + (list (service-extension shepherd-root-service-type + slim-shepherd-service) + (service-extension pam-root-service-type + slim-pam-service) - ;; Unconditionally add xterm to the system profile, to - ;; avoid bad surprises. - (service-extension profile-service-type - (const (list xterm))))) - (default-value (slim-configuration)))) + ;; Unconditionally add xterm to the system profile, to + ;; avoid bad surprises. + (service-extension profile-service-type + (const (list xterm))))) + + (default-value (slim-configuration))))) (define-deprecated (slim-service #:key (slim slim) (allow-empty-passwords? #t) auto-login? @@ -946,44 +970,30 @@ (define (gdm-shepherd-service config) (respawn? #t)))) (define gdm-service-type - (service-type (name 'gdm) - (extensions - (list (service-extension shepherd-root-service-type - gdm-shepherd-service) - (service-extension activation-service-type - (const %gdm-activation)) - (service-extension account-service-type - (const %gdm-accounts)) - (service-extension pam-root-service-type - gdm-pam-service) - (service-extension profile-service-type - gdm-configuration-gnome-shell-assets) - (service-extension dbus-root-service-type - (compose list - gdm-configuration-gdm)) - (service-extension localed-service-type - (compose - xorg-configuration-keyboard-layout - gdm-configuration-xorg)))) - - ;; For convenience, this service can be extended with an - ;; record. Take the first one that - ;; comes. - (compose (lambda (extensions) - (match extensions - (() #f) - ((config . _) config)))) - (extend (lambda (config xorg-configuration) - (if xorg-configuration - (gdm-configuration - (inherit config) - (xorg-configuration xorg-configuration)) - config))) - - (default-value (gdm-configuration)) - (description - "Run the GNOME Desktop Manager (GDM), a program that allows -you to log in in a graphical session, whether or not you use GNOME."))) + (handle-xorg-configuration gdm-configuration + (service-type (name 'gdm) + (extensions + (list (service-extension shepherd-root-service-type + gdm-shepherd-service) + (service-extension activation-service-type + (const %gdm-activation)) + (service-extension account-service-type + (const %gdm-accounts)) + (service-extension pam-root-service-type + gdm-pam-service) + (service-extension profile-service-type + gdm-configuration-gnome-shell-assets) + (service-extension dbus-root-service-type + (compose list + gdm-configuration-gdm)) + (service-extension localed-service-type + (compose + xorg-configuration-keyboard-layout + gdm-configuration-xorg)))) + (default-value (gdm-configuration)) + (description + "Run the GNOME Desktop Manager (GDM), a program that allows +you to log in in a graphical session, whether or not you use GNOME.")))) (define-deprecated (gdm-service #:key (gdm gdm) (allow-empty-passwords? #t) -- cgit v1.2.3