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: 59391 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 DBF1227BBE9; Thu, 25 Jan 2024 16:29:33 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,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 D590A27BBEB for ; Thu, 25 Jan 2024 16:29:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT2b6-0002JJ-2W; Thu, 25 Jan 2024 11:29:00 -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 1rT2b3-000237-Ph for guix-patches@gnu.org; Thu, 25 Jan 2024 11:28:57 -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 1rT2b3-0000uK-EW for guix-patches@gnu.org; Thu, 25 Jan 2024 11:28:57 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rT2b7-0007s5-NP; Thu, 25 Jan 2024 11:29:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68716] [PATCH gnome-team RFC 1/3] services: Modularise gnome-desktop-configuration. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, rg@raghavgururajan.name, vivien@planete-kraus.eu, guix-patches@gnu.org Resent-Date: Thu, 25 Jan 2024 16:29:01 +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: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, rg@raghavgururajan.name, vivien@planete-kraus.eu X-Debbugs-Original-Xcc: liliana.prikler@gmail.com, maxim.cournoyer@gmail.com, rg@raghavgururajan.name, vivien@planete-kraus.eu Received: via spool by 68716-submit@debbugs.gnu.org id=B68716.170620009130148 (code B ref 68716); Thu, 25 Jan 2024 16:29:01 +0000 Received: (at 68716) by debbugs.gnu.org; 25 Jan 2024 16:28:11 +0000 Received: from localhost ([127.0.0.1]:49009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT2aJ-0007qA-5I for submit@debbugs.gnu.org; Thu, 25 Jan 2024 11:28:11 -0500 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:46132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT2aH-0007ph-60 for 68716@debbugs.gnu.org; Thu, 25 Jan 2024 11:28:09 -0500 Received: by mail-ej1-x642.google.com with SMTP id a640c23a62f3a-a30f7c9574eso290644166b.0 for <68716@debbugs.gnu.org>; Thu, 25 Jan 2024 08:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706200077; x=1706804877; darn=debbugs.gnu.org; h=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=QSoEgaxAUCjXAA0xePFBox2yI3qijn9AG/X6pCsh/BY=; b=L+KHXO0rbVswPWoKzfm3BnAuFnlp/c3gc2tzHmoQuD1aybWvuLMBWnjDwVzOBeuYJ3 Dz8jFb2UGKWTPEM++KsljKEA19e3BA7uy++bvZKOYrEjQ97qq8KafMeIEjCVTqjcTVKO ULRLiFFtRCz5ziVZVHnXGJd8ktWOtzu0z60v6iMl9iaiotc7s2flyu9yiK+OoRt3Ytl3 ydFFyjdD3ezbKtkuK6LZ8BYNULwuXsCeap/NKaqwcJ4CIcwkm4uS+knDL62ReDXiUg0D WO0MczxsaYQjd4tuMu+K3KrsFqVPw5OsannXNr/NQtqL5mQm1PmPSpMnHEvjIQ3xGejK Ez1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706200077; x=1706804877; h=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=QSoEgaxAUCjXAA0xePFBox2yI3qijn9AG/X6pCsh/BY=; b=fS6kZmhKNZl+v0yth79K6RDDv8PnBe6u+0Iip6Zusikmo/1PJpGYFRmc36ypRd7tSD Gm9zu6MVtV93usPSeiYQnzN9bdXO5yqOL3v6ul6K/Z+etb4/9X7kqJ31N3JVzhBqVvZf PhlLjhpxf560cDtaMqoQf0y9Z3hX/hbP6DRB2Cg/Figv7NOrByS/HCf97a5aqH6/eJ3g 6pZVC4mIhGL1ml3p6hx97FGfYwjbes3sAQcIRZH2IoVU9/ocvLCCmD5AqoAlyMncsu0F AlnWo/DKXpQ1IT6MM5wR0F5VyKIw2QcHpH3BHg+CVJZ/HWYPDcDzA5GBMXFWXYR3jCHh 3+0w== X-Gm-Message-State: AOJu0YznzjpnZ5zjEB2Ywr+KMj3fYCE7WNwWox6Itn8K6BSPaN73CJgF /pGZlPARwXp1aNbNYHEf2Vk1oSdyGkpcfFXXoMOM+NashG8FVNVMGx1lTowxCgk= X-Google-Smtp-Source: AGHT+IHM4Ff32FA7ZVJQ/FWbKMuvfWLt0k2eh1avPqwcV5bVo0nUxGGLeSM/KM3/vBvZLA1p8adoqA== X-Received: by 2002:a17:906:4693:b0:a30:3418:8468 with SMTP id a19-20020a170906469300b00a3034188468mr449081ejr.132.1706200077411; Thu, 25 Jan 2024 08:27:57 -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 vx10-20020a170907a78a00b00a3162e76a6csm1037731ejc.215.2024.01.25.08.27.56 for <68716@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 08:27:57 -0800 (PST) Message-ID: 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 (%gnome-core-services, %gnome-core-shell) (%gnome-core-utilities, %gnome-essential-extras): New variables. (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 | 172 +++++++++++++++++++++++++++++++++++---- 1 file changed, 158 insertions(+), 14 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 5b79fbcda1..86be99252d 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) @@ -56,10 +57,16 @@ (define-module (gnu services desktop) #:use-module (gnu packages admin) #:use-module (gnu packages cups) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages fonts) + #:use-module (gnu packages geo) + #:use-module (gnu packages gstreamer) + #:use-module (gnu packages gtk) #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) #: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 +80,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 +89,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 ( @@ -137,8 +146,16 @@ (define-module (gnu services desktop) cups-pk-helper-service-type sane-service-type + %gnome-core-services + %gnome-core-shell + %gnome-core-utilities + %gnome-essential-extras 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 +1399,100 @@ (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 %gnome-core-services + (list accountsservice network-manager packagekit upower)) + +(define %gnome-core-shell + (list gdm + gnome-backgrounds + gnome-bluetooth + gnome-color-manager + gnome-desktop + gnome-initial-setup + gnome-keyring + gnome-menus + gnome-session + gnome-settings-daemon + gnome-shell-extensions + gnome-shell + gnome-user-docs + gnome-user-share + gvfs + mutter + orca + rygel + sushi + adwaita-icon-theme + glib-networking + gsettings-desktop-schemas)) + +(define %gnome-core-utilities + (list baobab + cheese + eog + epiphany + evince + file-roller + gnome-calculator + gnome-calendar + gnome-characters + gnome-clocks + gnome-console + gnome-contacts + gnome-disk-utility + gnome-font-viewer + gnome-maps + gnome-music + gnome-photos + gnome-screenshot + gnome-system-monitor + gnome-text-editor + gnome-weather + nautilus + simple-scan + totem + tracker-miners + xdg-desktop-portal-gnome + yelp)) + +(define %gnome-essential-extras + (list at-spi2-core + dbus + dconf + desktop-file-utils + font-abattis-cantarell + font-dejavu + gnome-default-applications ; XXX: Allow customization by records + gst-plugins-base + gst-plugins-good + gucharmap + pinentry-gnome3 + pulseaudio ; XXX: Replace with pipewire + shared-mime-info + system-config-printer + xdg-user-dirs + zenity)) + +(define-maybe/no-serialization package) + +(define-configuration/no-serialization gnome-desktop-configuration + (core-services + (list-of-packages %gnome-core-services) + "A list of packages that the GNOME Shell and applications may rely on.") + (shell + (list-of-packages %gnome-core-shell) + "A list of packages that constitute the GNOME Shell, without applications.") + (utilities + (list-of-packages %gnome-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 %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 +1506,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 +1566,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.")))