From patchwork Tue Apr 22 00:18:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 41913 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 6830227BC4B; Tue, 22 Apr 2025 01:20: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 D661527BC49 for ; Tue, 22 Apr 2025 01:20:34 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u71My-0000FU-Hh; Mon, 21 Apr 2025 20:20:12 -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 1u71Mq-0000EF-9u for guix-patches@gnu.org; Mon, 21 Apr 2025 20:20: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 1u71Mp-0002Kd-1b for guix-patches@gnu.org; Mon, 21 Apr 2025 20:20: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=Fref9yIh054FZTo/eF3BiXa+e9S6FfIizB5fUf8Reok=; b=jXebE9v6t6NYmxLc8JgZDv2oWNNnKt4CZOOybdg1wGP6Ltgi0QIgcGun0kcXWyoVjYhWIp3dukAq/naaYr+Dntj5ilih84T2BvfcTa0c75hPmUDCEBGse4jA/zKYqubCw3PabkYtp4seIzMCrynmzuSmdoRMk9Pg0sgSozkxRGdXmxz072TMdmIs3eKYugX+NCOM43NKoNUZmp+jOnUxt4ZXNEDWo27uRVPsxyWHRkFwf2UPl5fTPq/oE5wVYudGLB6I+x0jtnkYvgyfDRDH+ByL8VHu6a/3bU/b75qJ9mIi6MgJrnmC9nEFcDgtya7NIk77vGggbH5S+CR5ZJFmUA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u71Mo-00067B-Rc for guix-patches@gnu.org; Mon, 21 Apr 2025 20:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77266] [PATCH v4 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: Tue, 22 Apr 2025 00:20:02 +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.174528114723410 (code B ref 77266); Tue, 22 Apr 2025 00:20:02 +0000 Received: (at 77266) by debbugs.gnu.org; 22 Apr 2025 00:19:07 +0000 Received: from localhost ([127.0.0.1]:41197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u71Ls-00065L-Bx for submit@debbugs.gnu.org; Mon, 21 Apr 2025 20:19:07 -0400 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]:50621) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u71Lk-00064K-6M for 77266@debbugs.gnu.org; Mon, 21 Apr 2025 20:18:59 -0400 Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id D7330138076D; Mon, 21 Apr 2025 20:18:50 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 21 Apr 2025 20:18:50 -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=1745281130; x=1745367530; bh=Fref9yIh054FZTo/eF3BiXa+e9S6FfIizB5fUf8Reok=; b= WWOzvROiO3bzDFNpNdjSEN+sDaTX8R/h2GUEFTiuJpqL8FXnPtsGY9EngnHhC3Dt Ow20N5sWv9g+e1W1IZN9Bm1cn+jziu9faDpY/qCOPXz41QQ9hLhbnZrAihNiTKpJ Bh4NvLaYGwinyUJ6wplIVwImsV+N3Z2hsMg6eywLzJGrGkg72Z+MieuRxbrG1u08 PxJQF1o7Fb09QYYgOO5cZ3O7Pt7BHv6uFtHuFJxoQaP867oqxcmsxi+KX+u+RhoC XPDo9qp1LRQgiIPSin+5021Mvcy7ZOOqQ3toYq1ZDMs2XKvTPMM1ofmZOO3EkBbN w3sC9i0dHu6upVPWDmTg9g== 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=1745281130; x= 1745367530; bh=Fref9yIh054FZTo/eF3BiXa+e9S6FfIizB5fUf8Reok=; b=g Y21vN397nMoiH6Lw1sRg0VHPSRCC+zBlakryF/y1XOyJ2AS59vpPeUXmihTxSWtw mm41+oCO7qk+zIAxU9vSWrWZNAJadlaI4exNWaeTDPSWVw+6hDyMC9fLUWEFeUlW g2OAoBToYbNvk5Gs2tg3voR+9FHAKEvRvkz7frH+CeZw7gEayWdedkKI8K9BSZ8C ypVThMFfFIj+jnxX5G4IFX8cO8dn2fmzPthsvgtF6e/8uccPBSfWkjY0hAEd/bXU pOA39aScIHbpWDay7h9PRtYQwnXJJ6B5uHgOZK6EBP3f8PvgFAJ1maHs0k2VSSMw vAuuxmQdbNckNmkEI3YlQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvgedvvdejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvf evufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepkfgrnhcugfhurhgvuceo ihgrnhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpefggeehudelle eggfevueehffefgeevieejiedtteduleeluefhjeeiudfhudffteenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehirghnsehrvghtrhhoshhpvg gtrdhtvhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthht ohepjeejvdeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehirghnse hrvghtrhhoshhpvggtrdhtvh X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Apr 2025 20:18:50 -0400 (EDT) From: Ian Eure Date: Mon, 21 Apr 2025 17:18:44 -0700 Message-ID: <20250422001845.20855-2-ian@retrospec.tv> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250422001845.20855-1-ian@retrospec.tv> References: <20250422001845.20855-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 c313b7bc59..8fff8fd491 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