From patchwork Sun Apr 20 06:21:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 41819 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id EAC8D27BC4B; Sun, 20 Apr 2025 07:23:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5C01327BC49 for ; Sun, 20 Apr 2025 07:23:03 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u6O4d-0001Nb-7B; Sun, 20 Apr 2025 02:22:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u6O43-0001FV-QT for guix-patches@gnu.org; Sun, 20 Apr 2025 02:22:08 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u6O43-0008Ek-Gg for guix-patches@gnu.org; Sun, 20 Apr 2025 02:22:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=JGFo5qv/1WpDTrzYe0NHP9lNdrRkNTESdadqX3EABng=; b=RQnPb0CtnogmHyflPZPOJnYD6aIfC41fm8iZERU5Z1L776CA64OnTEI01dd45FMC6zldK2qeK+d+XMUDtHpwqsclZA1KQ18ItW7RATc4DWrUBQLnrYlgdGRihjusH0sLWPuL6MDzT0vBVBuKQbbAoVDjzp9/VJCpxi0LGPB9o4oyPWglt6rF2Lp9WGPuEAHZ31zKjpnL5DoQN37gtgmxqakEx61leiFPqJlyWofhp+hBgZC7Y0LZf2swG8YY4FG0ARnKynNm5jyIJLAkkm5/QTY71wyxUvdJL56OuZwTp+gH5gzh93E1qmCvhKKUyKLGS41jAe2zwoHJkbAz4iCU2A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u6O43-0001tB-CX for guix-patches@gnu.org; Sun, 20 Apr 2025 02:22:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77266] [PATCH v3 2/2] gnu: set-xorg-configuration: Be smarter finding the display-manager. Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 20 Apr 2025 06:22:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77266 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77266@debbugs.gnu.org Cc: Ian Eure Received: via spool by 77266-submit@debbugs.gnu.org id=B77266.17451301167234 (code B ref 77266); Sun, 20 Apr 2025 06:22:03 +0000 Received: (at 77266) by debbugs.gnu.org; 20 Apr 2025 06:21:56 +0000 Received: from localhost ([127.0.0.1]:43815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6O3v-0001sb-Eu for submit@debbugs.gnu.org; Sun, 20 Apr 2025 02:21:56 -0400 Received: from fout-a3-smtp.messagingengine.com ([103.168.172.146]:50223) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6O3j-0001rL-1d for 77266@debbugs.gnu.org; Sun, 20 Apr 2025 02:21:44 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id E4F191380140; Sun, 20 Apr 2025 02:21:37 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Sun, 20 Apr 2025 02:21:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1745130097; x=1745216497; bh=JGFo5qv/1WpDTrzYe0NHP9lNdrRkNTESdadqX3EABng=; b= EgCA7Ce7KgL8tCqxzoFvpOMhxahs0WVWcoW8ZuJvrhZAzwU3EQKu/f4V3b3JsZJw mxU8QeJUtGkjTjEvNEEgMyVQIulJ7wNVYT/aL2WoKVOiiNurccsNFwVCOOqLAzhh XPjoM4F0HSH2AxH7yj1QuT2s63lK2/7052kIG4TijtW8Fdcw+5qT8Z8HjBJaG0lZ 2pET5okJ5vk6mkxOJ5U7RMqtRZuX+YwpaDSKDreGZjQSsr9Aipognpnl+60ob+d0 OE/NrLp0mTpmNoaJUHBttiMKc35CKJCH/RPPWtOJRA1GZNlIkzI2rkmny/DnYYck gcMGa+q6YD2b7ycuGHaIHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1745130097; x= 1745216497; bh=JGFo5qv/1WpDTrzYe0NHP9lNdrRkNTESdadqX3EABng=; b=t OxPKGcy4HNqS2hEPtEW3RRoSMQZ9VxQExTFS13mAG7+GpCzH18AUoKN7PInMhoxu ej3rBl0le6x/RMOcJwrf6VUjkRIZVDSJqBBkMidRu1vndP094w+ip40oT3t5si9o 3ZL07yAm637Newrx3oa9ZT4GQo6AZh35rIMrAFblTRpb9KiE6WrIKo94Q52pxncu kHr4W+7kZppmp+rUpc1VRO27m794m4Zgjz/39u39U+iDVgGI7yYG28j2DETGU3RY p9Pale/1U5O4cdBvPF1WpUqn0gGJq42awDx6c72I1UCQofhVi+m8hdn6o+83qYsW yMmi/0N5R0W4FIiLRH8Sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeejudejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvf evufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceo ihgrnhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpefggeehudelle eggfevueehffefgeevieejiedtteduleeluefhjeeiudfhudffteenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhoshhpvg gtrdhtvhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjeejvdeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehirghnse hrvghtrhhoshhpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Apr 2025 02:21:37 -0400 (EDT) From: Ian Eure Date: Sat, 19 Apr 2025 23:21:21 -0700 Message-ID: <20250420062123.22442-3-ian@retrospec.tv> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250420062123.22442-1-ian@retrospec.tv> References: <20250420062123.22442-1-ian@retrospec.tv> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/desktop.scm (desktop-services-for-system): Export. * gnu/services/desktop.scm (set-xorg-configuration): Look for a display-manager service in (desktop-services-for-system). * gnu/services/desktop.scm (set-xorg-configuration): Remove TODO comment. Change-Id: Iceda2d13d16435517cd92bcb49e6937ed096f392 --- gnu/services/desktop.scm | 1 + gnu/services/xorg.scm | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index fe034cfa8f..f7fb3c5bf0 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -199,6 +199,7 @@ (define-module (gnu services desktop) seatd-configuration seatd-service-type + desktop-services-for-system %desktop-services)) ;;; Commentary: diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index cb933693b7..4aec265098 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -16,6 +16,7 @@ ;;; Copyright © 2023 muradm ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> +;;; Copyright © 2025 Ian Eure ;;; ;;; This file is part of GNU Guix. ;;; @@ -43,6 +44,7 @@ (define-module (gnu services xorg) #: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) @@ -139,6 +141,7 @@ (define-module (gnu services xorg) gdm-configuration gdm-service-type + xorg-configuration-service-type handle-xorg-configuration set-xorg-configuration)) @@ -1391,16 +1394,24 @@ (define gdm-service-type "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 (xorg-configuration-service? s) + "Returns #t if @var{s} is a service carrying xorg configuration." + (let ((val (service-value s))) + (and (record? val) + (memq 'xorg-configuration + (record-type-fields (record-type-descriptor val)))))) + +(define (xorg-configuration-service-type services) + "Return the service type of the first service in @var{services} +which carries xorg configuration. " + (let ((lmst (find xorg-configuration-service? services))) + (when lmst (service-kind lmst)))) + (define* (set-xorg-configuration config #:optional (login-manager-service-type - (if (target-x86-64?) - gdm-service-type - sddm-service-type))) + (xorg-configuration-service-type + (desktop-services-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