From 8361b59fd4e918dbc30f33126862e3d60f7eda0e Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 17 Jan 2026 12:28:34 +0100 Subject: [PATCH] gnu: %desktop-services: Switch to GDM on 64-bit systems. * gnu/services/desktop.scm (login-manager-service-type-for-system): New variable. (desktop-services-for-system): Use it. * gnu/services/xorg.scm (set-xorg-configuration): Default the login manager to login-manager-service-type-for-system. * gnu/system/examples/desktop.tmpl: Determine the support of Gnome by checking for supported package. Fixes: #5388 Change-Id: I0d512a7c31188cea0335e66f00a6d65ae59d09a4 --- gnu/services/desktop.scm | 21 ++++++++++++++------- gnu/services/xorg.scm | 9 ++------- gnu/system/examples/desktop.tmpl | 18 ++++++++++-------- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 59dc5b347493b5f2a2ad8e066bb5766dfcce1542..72dc0ce7c8be95dcf73af1474b5964707a26fa1b 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -216,6 +216,7 @@ seatd-configuration seatd-service-type + login-manager-service-type-for-system %desktop-services)) ;;; Commentary: @@ -2510,6 +2511,18 @@ applications needing access to be root.") (service-extension shepherd-root-service-type seatd-shepherd-service))) (default-value (seatd-configuration)))) +(define* (login-manager-service-type-for-system + #:optional + (system (or (%current-target-system) + (%current-system)))) + "Return a workable login-manager service type that is part of %desktop-services +on the given SYSTEM." + ;; FIXME: Since GDM depends on more dependencies that do not build on i686, + ;; keep SDDM on it for the time being. + (if (target-64bit? system) + gdm-service-type + sddm-service-type)) + ;;; ;;; The default set of desktop services. @@ -2520,13 +2533,7 @@ applications needing access to be root.") (%current-system)))) ;; List of services typically useful for a "desktop" use case. - ;; Since GDM depends on Rust and Rust is not available on all platforms, - ;; use SDDM as the fall-back display manager. - ;; TODO: Switch the condition to use (supported-package? "rust") and make - ;; a news entry about the change. - (cons* (if (string-prefix? "x86_64" system) - (service gdm-service-type) - (service sddm-service-type)) + (cons* (service (login-manager-service-type-for-system)) ;; Screen lockers are a pretty useful thing and these are small. (service screen-locker-service-type diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 25f44566bebb6e35ce9cae4436a1049ea95d9b6a..8024827393e2a5df48d7f6ded7b13a5f1655738f 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -43,6 +43,7 @@ #:use-module (gnu system privilege) #:use-module (gnu services base) #:use-module (gnu services dbus) + #:use-module (gnu services desktop) #:use-module (gnu packages base) #:use-module (gnu packages guile) #:use-module (gnu packages xorg) @@ -1379,16 +1380,10 @@ polkit.addRule(function(action, subject) { "Run the GNOME Desktop Manager (GDM), a program that allows you to log in in a graphical session, whether or not you use GNOME.")))) -;; Since GDM depends on Rust and Rust is not available on all platforms, -;; use SDDM as the fall-back display manager. -;; TODO: Switch the condition to take into account if Rust is supported and -;; match the configuration in desktop-services-for-system. (define* (set-xorg-configuration config #:optional (login-manager-service-type - (if (target-x86-64?) - gdm-service-type - sddm-service-type))) + (login-manager-service-type-for-system))) "Tell the log-in manager (of type @var{login-manager-service-type}) to use @var{config}, an record." (simple-service 'set-xorg-configuration diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index 2d65f222947bdc0f2c7b7670e9b86557b6a92b1a..afe5ae2d2ba63fb46c035be699e8d49a14cec5b9 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl @@ -3,7 +3,8 @@ ;; for a "desktop" setup with GNOME and Xfce where the ;; root partition is encrypted with LUKS, and a swap file. -(use-modules (gnu) (gnu system nss) (guix utils)) +(use-modules (gnu) (gnu system nss) (guix utils) + (guix packages)) (use-service-modules desktop sddm xorg) (use-package-modules gnome) @@ -73,7 +74,10 @@ ;; by clicking the gear. Use the "desktop" services, which ;; include the X11 log-in service, networking with ;; NetworkManager, and more. - (services (if (target-x86-64?) + (services (if (supported-package? gnome + (or (and=> (%current-target-system) + gnu-triplet->nix-system) + (%current-system))) (append (list (service gnome-desktop-service-type) (service xfce-desktop-service-type) (set-xorg-configuration @@ -81,16 +85,14 @@ (keyboard-layout keyboard-layout)))) %desktop-services) - ;; FIXME: Since GDM depends on Rust (gdm -> gnome-shell -> gjs - ;; -> mozjs -> rust) and Rust is currently unavailable on - ;; non-x86_64 platforms, we use SDDM and Mate here instead of - ;; GNOME and GDM. + ;; FIXME: Since Gnome depends on Rust and Rust is currently + ;; unavailable on some platforms, we use MATE here instead of + ;; GNOME. (append (list (service mate-desktop-service-type) (service xfce-desktop-service-type) (set-xorg-configuration (xorg-configuration - (keyboard-layout keyboard-layout)) - sddm-service-type)) + (keyboard-layout keyboard-layout)))) %desktop-services))) ;; Allow resolution of '.local' host names with mDNS.