From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id YNvxNgQ/wWWagAEAqHPOHw:P1 (envelope-from ) for ; Mon, 05 Feb 2024 21:03:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id YNvxNgQ/wWWagAEAqHPOHw (envelope-from ) for ; Mon, 05 Feb 2024 21:03:16 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=planete-kraus.eu header.s=albinoniB header.b="d 2zS4HF"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1707163396; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=sRKlMFRWScOn13/UIBIYlmOYfghgYgmXOdbLmqU0l90=; b=LLvhy7ojew/VGfFcn4PEYkYix56Ai/fpdVLfgoFreqtj1tG2HQZpUA638M5kVPiQsbphBj fSM21vlieh4DWXKoSUn02wN+4XpGYzfppcTHokCL0rkZgKJiijN5GhBgFsvM1sppi/Vozl aVCuTQGjRrM9VqhfRi5MD3DCzLdKVkNx9MR07YSVdm70zE2caSsN2NJI21tZPTKGpLpSBk sp7DBiNd5mQqilmVyUZ0oEX/l/j+IqzUmVolGc9f2zGxk7tTMTjE6fqrgSdN8JBhWs2pY2 Ns86bCfE1/VIf32PJ7tq6hcF8ke0K5fEiTZS9DHbbqdCwjAhnyW54IVgK4H38Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=planete-kraus.eu header.s=albinoniB header.b="d 2zS4HF"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1707163396; a=rsa-sha256; cv=none; b=aaW/9bIKgjCUe+0r9DB/CjKO+V8lAlDQ/fb/MSWwv46vyOPgQvI2gs7z+zfp1nMn1ffrfY TV0rX6XUbW31P1lC+cOTe1nixBlL+uETyAcFyzWOEwCzi2MdutvLMPaXa2f+Ma1bh05W9K LV0SJRbaxitojqbYaORCQvxY50we9nZ3LDd6rG6GFsSVrbh9+56ht9WqZrI0LVkQRQUHxZ L9kQDLkHq6PcNZ2MdSbgNsp1JCsg0gT8TB0bPW66fF2jHnXRFa3BGDpkVVpQceZYkX4x/G csnwt4c/UfU3nxxcXWXv/NK2HeyE0ChTd3rbCriIJfQfr20dDyqeUH/6zKpqWQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B5CC317249 for ; Mon, 5 Feb 2024 21:03:16 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rX5B6-0006hi-NJ; Mon, 05 Feb 2024 15:02:52 -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 1rX5B5-0006h0-9f for guix-patches@gnu.org; Mon, 05 Feb 2024 15:02:51 -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 1rX5B5-0001dl-0z for guix-patches@gnu.org; Mon, 05 Feb 2024 15:02:51 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rX5BH-0004Hb-MU for guix-patches@gnu.org; Mon, 05 Feb 2024 15:03:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68716] [PATCH gnome-team v2 5/5] services: gnome: Use a blocklist for udev configurations. Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Feb 2024 20:03:03 +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@planete-kraus.eu, liliana.prikler@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 68716-submit@debbugs.gnu.org id=B68716.170716336516404 (code B ref 68716); Mon, 05 Feb 2024 20:03:03 +0000 Received: (at 68716) by debbugs.gnu.org; 5 Feb 2024 20:02:45 +0000 Received: from localhost ([127.0.0.1]:52364 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX5Az-0004GV-8F for submit@debbugs.gnu.org; Mon, 05 Feb 2024 15:02:45 -0500 Received: from planete-kraus.eu ([89.234.140.182]:37406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rX5Aj-0004Eo-9b for 68716@debbugs.gnu.org; Mon, 05 Feb 2024 15:02:29 -0500 Received: from planete-kraus.eu (localhost [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 5e4f27b1; Mon, 5 Feb 2024 20:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:in-reply-to:references:from:date:subject:to:cc :mime-version; s=albinoniB; bh=iFmy3EYCOqyEiskktEKwe8ue73s=; b=d 2zS4HFG75iq593//jIO4xwAy+nN5ZmKVWXNZxHhcB8Y1tlghS2xdtp4RMkD8QMK1 EVRG5Dp6BPt5SN44Fnq//GQnQ/4EYLUCJ1j1juUarU3dg0jwTydrgovndlvaAPAs UhAcXrlZ+GNRRUiNUu1DCdZEwqFUlIOpX24SBAdsFYihBBUyl7k4JR3ILxrzK5yN rPIaBzfcdhwEy32fCQrFOZWTeBmLXPZW6YnyksFkkVi14PcWx5LVduFWKeOLwUvv tMGlOPDL4QcY5bW0s5YGPMT6uKFC0eYHKmVSvuD9MIQKdgLV3XK6449drMMX+g4a iASvFnXmT372WCtRBf8Kw== Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id 4ca062d0 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Mon, 5 Feb 2024 20:02:14 +0000 (UTC) Message-ID: In-Reply-To: References: Date: Mon, 5 Feb 2024 19:30:25 +0100 MIME-Version: 1.0 User-Agent: Evolution 3.48.4 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: , Reply-to: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches From: Vivien Kraus via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.67 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -5.67 X-Migadu-Queue-Id: B5CC317249 X-TUID: vBqAMf/Fd8Yn The gnome-udev-configuration-files now lists every udev rule and hardware file, and remove files based on a user-supplied list of regular expressions. * gnu/services/desktop.scm (gnome-desktop-configuration): Add the udev-blocklist field. (gnome-udev-configuration-files): Change behavior. Change-Id: I6df4b896652581c42a35ea3ba1e4849ad72d12ef --- gnu/services/desktop.scm | 63 ++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 263ae61698..8045406c10 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -87,6 +87,7 @@ (define-module (gnu services desktop) #:use-module (guix ui) #:use-module (guix utils) #:use-module (guix gexp) + #:use-module (guix modules) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) #:use-module (srfi srfi-35) @@ -156,6 +157,7 @@ (define-module (gnu services desktop) gnome-desktop-configuration-shell gnome-desktop-configuration-utilities gnome-desktop-configuration-extra-packages + gnome-desktop-configuration-udev-blocklist gnome-desktop-service gnome-desktop-service-type @@ -1494,7 +1496,12 @@ (define-configuration/no-serialization gnome-desktop-configuration "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.")) +GNOME users.") + (udev-blocklist + (list-of-strings '()) + "A list of regular expressions denoting udev rules or hardware file names +provided by any package, that should not be installed. By default, every udev +rule and hardware file specified by all packages are installed.")) (define (gnome-package gnome name) "Return the package NAME among the GNOME package inputs. NAME can be a @@ -1509,20 +1516,46 @@ (define (gnome-packages gnome names) (define (gnome-udev-configuration-files config) "Return the list of GNOME dependencies that provide udev rules and hardware files." - (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")))))))) + (let* ((all-packages + (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)))) + (list + (computed-file + "gnome-udev-configurations" + (with-imported-modules + (source-module-closure '((guix build utils))) + #~(begin + (use-modules (guix build utils)) + (for-each + (lambda (package) + (with-directory-excursion + package + (for-each + (lambda (filename) + (mkdir-p (dirname (string-append #$output "/" filename))) + (copy-file filename (string-append #$output "/" filename))) + (find-files "." + (lambda (name st) + (or (string-prefix? "./lib/udev/" name) + (string-prefix? "./libexec/udev/" name))))))) + (list #$@all-packages)) + (for-each + (lambda (pattern) + (for-each + delete-file-recursively + (find-files #$output pattern))) + (list #$@(gnome-desktop-configuration-udev-blocklist config))))))))) (define (gnome-polkit-settings config) "Return the list of GNOME dependencies that provide polkit actions and -- 2.41.0