From patchwork Mon May 19 00:07:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 42734 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 E0EBB27BC4B; Mon, 19 May 2025 01:08:35 +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 5670227BC49 for ; Mon, 19 May 2025 01:08:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uGo36-0008Cl-9d; Sun, 18 May 2025 20:08:08 -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 1uGo31-0008Bw-QS for guix-patches@gnu.org; Sun, 18 May 2025 20:08:05 -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 1uGo31-0005zq-Et for guix-patches@gnu.org; Sun, 18 May 2025 20:08: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=5WgV5ddVGc1Wvis7VE/JLT0kND7cIDGpevn3/8G//Fg=; b=erjqpLYTTDYfZ8Vrq7AUZXTUn/ypBQB3pr1cHynla2VK7+ZvL0IPL/00f+v5IRelnpqVsSQDUcg9UdeBaG0kcrFW9/4vrGPrX+LOIsttaBx+f6BP1zySwuc35S+0DjiOZMYV0BFxup/uSAdGNMA4WPXSv4jFkoZpk4JHH6eHSnZoVQlufwTDHYgZPB10E2/sHjobzxAm6HSGb5F0qQJWIZseIp2hHXaMp2gC/mG/idfpmp5fm47rslzCZNaRWFN61nxghk7+lOmHTX5l9HVK6XwBEsZCeaSpKz4ajIjqY9TgVgHnLUVv3Se4BJdbeOVKF4TPz/oJY9s3jknMU5rArQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uGo31-00054u-8f for guix-patches@gnu.org; Sun, 18 May 2025 20:08:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77266] [PATCH v5 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: Mon, 19 May 2025 00:08: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.174761325619351 (code B ref 77266); Mon, 19 May 2025 00:08:03 +0000 Received: (at 77266) by debbugs.gnu.org; 19 May 2025 00:07:36 +0000 Received: from localhost ([127.0.0.1]:33790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uGo2Z-00051w-Kv for submit@debbugs.gnu.org; Sun, 18 May 2025 20:07:36 -0400 Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]:57761) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uGo2U-00051B-Lr for 77266@debbugs.gnu.org; Sun, 18 May 2025 20:07:32 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 3F57125400C3; Sun, 18 May 2025 20:07:25 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Sun, 18 May 2025 20:07:25 -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=fm2; t=1747613245; x=1747699645; bh=5WgV5ddVGc1Wvis7VE/JLT0kND7cIDGpevn3/8G//Fg=; b= GfYaTRxFJEgihgB0I72nswjv91GPGe727OWiXv4pxZoqJOSTVDaRduJgQe/j/w2K OPEyVP8uw4/KJ3V/xmuxKfAyZogpvQTQXnV/Vlt1T4ASqTKLOcd3rlgUKYl8eLVH YlBTHzCndbiZVqYcujYi3XObQS3/iGkLUueiRuVMag3KbX9koQ/b97I8WebjjPEB FWYVkb5aHui/2wS/jRsWvgTe6kFelu/XCvLYh3kB50c/Wn/jzFcHxWMUJc06ah0X WUicDZ0/jCzrblNHKX0lDdqB8pY4Xp3PTQihwV7pmUIuw4+9w7WAoOoImPKG3mQM moKtm9n5vuByliM9I8Ruxw== 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=fm3; t=1747613245; x= 1747699645; bh=5WgV5ddVGc1Wvis7VE/JLT0kND7cIDGpevn3/8G//Fg=; b=w IH10GC+90HSkImLcpTotZLlMhpoS5x7r04RhuHuXlxB1q7c+lkd/klyVb/R4nuh+ 5F1lwKRbvrZem4BVw+VAcHAcRz9cjg/K8SCg/RuDGUATFxuF0Spuil9TdWq6RKLH DQ70+9VU9E0YCJHyKzDTmcEew16RR2cOdOLHZrNJYnB03E9WuEzNZYl/feJ4U9MK ThFdRT+2ZrACNPmt7XS+zLuYn4r9qJj3U8c2uN3mGuaedH8z/5w1uQXjpxw8gQGG lTGA6/A97O5fD45WFvkhi1R1hz/D9yr38U2i0Vf3eizcedfgD19qxBRDETy/WlNF RQaGK/sYnglPv5G8QPTlw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefudelledtucetufdoteggodetrf 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, 18 May 2025 20:07:24 -0400 (EDT) From: Ian Eure Date: Sun, 18 May 2025 17:07:11 -0700 Message-ID: <20250519000718.2147-3-ian@retrospec.tv> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250519000718.2147-1-ian@retrospec.tv> References: <20250519000718.2147-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 12560a6249d..fd4a452aa56 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -205,6 +205,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 c2ee68b1ab2..9b82882116e 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)) @@ -1392,16 +1395,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