From patchwork Thu Jan 25 15:35:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 60449 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 7635527BBE9; Sat, 17 Feb 2024 08:26:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable 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 2F36127BBE2 for ; Sat, 17 Feb 2024 08:26:47 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbG12-0006J7-Q0; Sat, 17 Feb 2024 03:25:44 -0500 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 1rbG11-0006H6-2v for guix-patches@gnu.org; Sat, 17 Feb 2024 03:25:43 -0500 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 1rbG10-00074R-R7 for guix-patches@gnu.org; Sat, 17 Feb 2024 03:25:42 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbG1K-0005Rb-I3 for guix-patches@gnu.org; Sat, 17 Feb 2024 03:26:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68716] [PATCH v5 3/8] services: Modularise gnome-desktop-configuration. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Feb 2024 08:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68716 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68716@debbugs.gnu.org Cc: rg@raghavgururajan.name, Vivien Kraus , Maxim Cournoyer Received: via spool by 68716-submit@debbugs.gnu.org id=B68716.170815834420853 (code B ref 68716); Sat, 17 Feb 2024 08:26:02 +0000 Received: (at 68716) by debbugs.gnu.org; 17 Feb 2024 08:25:44 +0000 Received: from localhost ([127.0.0.1]:60396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbG11-0005QD-Ob for submit@debbugs.gnu.org; Sat, 17 Feb 2024 03:25:44 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:50371) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbG0t-0005P0-Hm for 68716@debbugs.gnu.org; Sat, 17 Feb 2024 03:25:38 -0500 Received: by mail-ed1-f65.google.com with SMTP id 4fb4d7f45d1cf-55ee686b5d5so1809763a12.0 for <68716@debbugs.gnu.org>; Sat, 17 Feb 2024 00:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708158249; x=1708763049; darn=debbugs.gnu.org; h=cc:to:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=y5fhioA4z5D+5iKHDnf4iX5nY5uAvB+83CXIUhdsb5o=; b=jrxr1DGATeETjLTFZhcg7yuOVHEmNYpBjKMgFrW6ouYJ2MUSqI/KTKf8maqqbrpP6B 5ZIvOfSGkx4A6/MOmmZWS/JI86l6XFytp7qnfiDKvCQ3WAI73zYipvxm9twMSPAbbSEQ OC5t4xzzndh6XsYBQSQA15GRFFz2od9WVSht7OUBL2sQ1QEAOCWIcXbBP6dhSZbutLfh JVtWwVFDdW0YRPdZaGIeo6wEKV+qK8fwB3GiayshqLJTzvu8O4Y2KH9lZutNoTGOl8/n 42ljuakl+XqdVzHSDjPoX5E5JGORB5SJzaNOhSoZSxil1UJszYdrJO8p8CAEfn6IdRmC TPfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708158250; x=1708763050; h=cc:to:content-transfer-encoding:mime-version:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y5fhioA4z5D+5iKHDnf4iX5nY5uAvB+83CXIUhdsb5o=; b=vFa5GKRxCoYTfLomQfJahdse5Ijd64KsDe6Q8yccVLviCo2ObFw07dQR6slDdKCVtM cspMHSeMNbxgzUDcXw53z/vGmfmorz771pv37D70VvoyZvEvA2wHbLaTX7QkpiA33BJ8 uu5w5GTzGyYscKFPBGvTtxh16ZCH9w3f6JhLwQQmb9dgpn6iKQ5FOpRx0qBR992MD2ip 2MDjVgKskMOCDB6nZjlC4dJxEaOSh4cyxGBtZD+aJKkzboa017rfJuG4WBjTu40JlGFD bd6iNk8pIHEVfNNNhTMjcb6aUjDqP5rg07INisoU28Wn9K6WPAKCOkJprQwjG+TKMfxl oaUw== X-Gm-Message-State: AOJu0YwCo8VoBIPLwLS31xR42y22W3SHMbqWYaDselzf2zoYWTrxKT1b FsJOucMGV7fex8i0lMXWopEbFx1mnGWMNjFeQanSVNoOFFU/b+Dy4l6KqT9AnMw= X-Google-Smtp-Source: AGHT+IFLH9rkoIghhs6vceS1L3C3PCOGjV5Z5U4BJay1srVdpRtnFOrIQnURUFhN9rnjAzc0r+Mi0w== X-Received: by 2002:a05:6402:1851:b0:564:1ecd:35d9 with SMTP id v17-20020a056402185100b005641ecd35d9mr592667edy.8.1708158249575; Sat, 17 Feb 2024 00:24:09 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id cs1-20020a0564020c4100b005617cebd051sm707218edb.78.2024.02.17.00.24.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 00:24:09 -0800 (PST) Message-ID: <2869f41835d62e93d4f501f5bbb50a1c7a67c91c.1708158195.git.liliana.prikler@gmail.com> In-Reply-To: References: From: Liliana Marie Prikler Date: Thu, 25 Jan 2024 16:35:17 +0100 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/gnome.scm (extract-propagated-inputs): New variable. (gnome-desktop-configuration): Add ‘core-services’, ‘shell’, ‘utilities’, and ‘extra-packages’. Deprecate ‘gnome’. (gnome-desktop-configuration-core-services, gnome-desktop-configuration-shell) (gnome-desktop-configuration-utilities) (gnome-desktop-configuration-extra-packages): Export publicly. (gnome-udev-rules, gnome-polkit-settings): Adjust accordingly. (gnome-profile): New variable. (gnome-desktop-service-type): Adjust accordingly. --- gnu/services/desktop.scm | 97 ++++++++++++++++++++++++++++++++++------ 1 file changed, 83 insertions(+), 14 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 5b79fbcda1..0667acfaba 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -37,6 +37,7 @@ (define-module (gnu services desktop) #:use-module (gnu services) #:use-module (gnu services shepherd) #:use-module (gnu services base) + #:use-module (gnu services configuration) #:use-module (gnu services dbus) #:use-module (gnu services avahi) #:use-module (gnu services xorg) @@ -60,6 +61,7 @@ (define-module (gnu services desktop) #:use-module (gnu packages kde) #:use-module (gnu packages kde-frameworks) #:use-module (gnu packages kde-plasma) + #:use-module (gnu packages pulseaudio) #:use-module (gnu packages xfce) #:use-module (gnu packages avahi) #:use-module (gnu packages xdisorg) @@ -73,6 +75,7 @@ (define-module (gnu services desktop) #:use-module (gnu packages nfs) #:use-module (gnu packages enlightenment) #:use-module (guix deprecation) + #:use-module (guix diagnostics) #:use-module (guix records) #:use-module (guix packages) #:use-module (guix store) @@ -81,6 +84,7 @@ (define-module (gnu services desktop) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-35) #:use-module (ice-9 format) #:use-module (ice-9 match) #:export ( @@ -139,6 +143,10 @@ (define-module (gnu services desktop) gnome-desktop-configuration gnome-desktop-configuration? + gnome-desktop-configuration-core-services + gnome-desktop-configuration-shell + gnome-desktop-configuration-utilities + gnome-desktop-configuration-extra-packages gnome-desktop-service gnome-desktop-service-type @@ -1382,11 +1390,34 @@ (define sane-service-type ;;; GNOME desktop service. ;;; -(define-record-type* gnome-desktop-configuration - make-gnome-desktop-configuration - gnome-desktop-configuration? - (gnome gnome-desktop-configuration-gnome - (default gnome))) +(define-maybe/no-serialization package) + +(define (extract-propagated-inputs package) + ;; Drop input labels. Attempt to support outputs. + (map + (match-lambda + ((_ (? package? pkg)) pkg) + ((_ (? package? pkg) output) (list pkg output))) + (package-propagated-inputs package))) + +(define-configuration/no-serialization gnome-desktop-configuration + (core-services + (list-of-packages (extract-propagated-inputs gnome-meta-core-services)) + "A list of packages that the GNOME Shell and applications may rely on.") + (shell + (list-of-packages (extract-propagated-inputs gnome-meta-core-shell)) + "A list of packages that constitute the GNOME Shell, without applications.") + (utilities + (list-of-packages (extract-propagated-inputs gnome-meta-core-utilities)) + "A list of packages that serve as applications to use on top of the \ +GNOME Shell.") + (gnome (maybe-package) "Deprecated. Do not use.") + (extra-packages + (list-of-packages (extract-propagated-inputs gnome-essential-extras)) + "A list of GNOME-adjacent packages to also include. This field is intended +for users to add their own packages to their GNOME experience. Note, that it +already includes some packages that are considered essential by some (most?) +GNOME users.")) (define (gnome-package gnome name) "Return the package NAME among the GNOME package inputs. NAME can be a @@ -1400,18 +1431,56 @@ (define (gnome-packages gnome names) (define (gnome-udev-rules config) "Return the list of GNOME dependencies that provide udev rules." - (let ((gnome (gnome-desktop-configuration-gnome config))) - (gnome-packages gnome '("gnome-settings-daemon")))) + (let* ((gnome (gnome-desktop-configuration-gnome config)) + (shell (gnome-desktop-configuration-shell config))) + (or (any (match-lambda + ((and pkg (= package-name "gnome-settings-daemon")) + (list pkg)) + (_ #f)) + shell) + (and (maybe-value-set? gnome) + (gnome-packages gnome '("gnome-settings-daemon"))) + (raise + (condition + (&error-location + (location (gnome-desktop-configuration-source-location config))) + (&message (message (G_ "Missing gnome-settings-daemon")))))))) (define (gnome-polkit-settings config) "Return the list of GNOME dependencies that provide polkit actions and rules." - (let ((gnome (gnome-desktop-configuration-gnome config))) - (gnome-packages gnome - '("gnome-settings-daemon" - "gnome-control-center" - "gnome-system-monitor" - "gvfs")))) + (let ((gnome (gnome-desktop-configuration-gnome config)) + (shell (gnome-desktop-configuration-shell config))) + (or (any (match-lambda ((and pkg (= package-name "gvfs")) (list pkg)) + (_ #f)) + shell) + (and (maybe-value-set? gnome) + (gnome-packages gnome + '("gnome-settings-daemon" + "gnome-control-center" + "gnome-system-monitor" + "gvfs"))) + (raise + (condition + (&error-location + (location (gnome-desktop-configuration-source-location config))) + (&message (message (G_ "Missing gvfs")))))))) + +(define (gnome-profile config) + "Return a list of packages propagated through CONFIG." + (append + (gnome-desktop-configuration-core-services config) + (gnome-desktop-configuration-shell config) + (gnome-desktop-configuration-utilities config) + (let ((gnome-meta (gnome-desktop-configuration-gnome config))) + (if (maybe-value-set? gnome-meta) + (begin + (warning + (gnome-desktop-configuration-source-location config) + (G_ "Using a meta-package for gnome-desktop is discouraged.~%")) + (list gnome-meta)) + (list))) + (gnome-desktop-configuration-extra-packages config))) (define gnome-desktop-service-type (service-type @@ -1422,7 +1491,7 @@ (define gnome-desktop-service-type (service-extension polkit-service-type gnome-polkit-settings) (service-extension profile-service-type - (compose list gnome-desktop-configuration-gnome)))) + gnome-profile))) (default-value (gnome-desktop-configuration)) (description "Run the GNOME desktop environment.")))