From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id SBilIspYz2V8UgEAe85BDQ:P1 (envelope-from ) for ; Fri, 16 Feb 2024 13:44:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id SBilIspYz2V8UgEAe85BDQ (envelope-from ) for ; Fri, 16 Feb 2024 13:44:58 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=XWaIUZ36; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708087498; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=FaNHHr3tQ1pZmSq7BDJeYMJLzSa6LK16q5JFFSL7bVY=; b=qDcTVv1qDID6kzP55Z5c4gKZMruBA6ZZxBfm3F7G+u2slXz5rMkml0FSQZyB5O4WIJwBEp 71Yo0fNia+WiYPUArHLAmFNaVBpKnPLCnEPais6p+DDuvO8jCT54pP/by2B0WDODKrKmDH MkVdWy+6u6Sh82nyFHPZT5r4Da4zIMIXGYem226sFWXIJRX5bqUjbOGep+V5QANYCAEPpF NOx1YL4g95FVC1VBTPkggdXQHGgxxLowwX9jSfeaGGz2Pmv38A4vU8fTShBc1dj+Hvc22/ TELRC+oE4LZNdDyKNrcCXnt/zU38ULfaplGeWueCLmqglRSVfUtJFKoRJgZWFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=XWaIUZ36; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708087498; a=rsa-sha256; cv=none; b=jMmO/+GIY0pSYF0fY2ulUn2TXbLg9MbAHL270d89mgYLerlH3+a2QPFVt/pEEoJtWzADLV pGebNt+QHXBBURf/fDk30tI/b6LesUovlNroW3qKNZU6ulXC9TczL/Fgv+k04/wSSrZj3j C99pf1eVgbpYDyvIrLtHqFIiDSyKMVPYWDSIZrVlut9trzBj9LK4ufp5b4iI9h9k9EiEJC NH54uUOaJ7XuvH6zWbfcosgoLKByrTqv/5WftBfHISBmFtU4chF5gCm9z9Zy2OPHGsGwEU isNi7xeAZefqsEblHMJra6vbMTsL9pGjSEuQMzjoXY/eBjHV0KOorwE232aykA== 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 450606A883 for ; Fri, 16 Feb 2024 13:44:58 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raxaB-00007P-Av; Fri, 16 Feb 2024 07:44:47 -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 1raxa7-00006J-QD for guix-patches@gnu.org; Fri, 16 Feb 2024 07:44:44 -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 1raxa7-0004Qj-I0 for guix-patches@gnu.org; Fri, 16 Feb 2024 07:44:43 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1raxaQ-0008DM-MD; Fri, 16 Feb 2024 07:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68716] [PATCH gnome-team v4 4/7] services: Extend udev capabilities of gnome-desktop-service. Resent-From: Vivien Kraus 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: Fri, 16 Feb 2024 12:45: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: 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.170808747231482 (code B ref 68716); Fri, 16 Feb 2024 12:45:02 +0000 Received: (at 68716) by debbugs.gnu.org; 16 Feb 2024 12:44:32 +0000 Received: from localhost ([127.0.0.1]:57990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raxZv-0008Bh-QK for submit@debbugs.gnu.org; Fri, 16 Feb 2024 07:44:32 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:44231) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raxZq-0008Aj-M9 for 68716@debbugs.gnu.org; Fri, 16 Feb 2024 07:44:28 -0500 Received: by mail-ej1-f68.google.com with SMTP id a640c23a62f3a-a26fa294e56so301197666b.0 for <68716@debbugs.gnu.org>; Fri, 16 Feb 2024 04:44:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708087382; x=1708692182; darn=debbugs.gnu.org; h=to:content-transfer-encoding:mime-version:subject:date:references :in-reply-to:message-id:from:from:to:cc:subject:date:message-id :reply-to; bh=FaNHHr3tQ1pZmSq7BDJeYMJLzSa6LK16q5JFFSL7bVY=; b=XWaIUZ36t973lYYI9WQgKlVMnlkmOwdbg5wqtjeLYSF4xW9YmUepYMG06RYy7kKyPj 3izuPyaq4wIUD4QrgzpC2ene5+PHbEM46tEcUk5YjIjRSI8zMvVrRH//Op+RNync+Cjr fg4K6SPW3fh1YRZSuwo9sl3XY1YWp8XtabZWPetTcJWYtzHDg1ddoq8vDZWS9LTocl8+ 56Yh4Tc3sI34vABU07IBFBWEOs6UHi8YM8HZ1I5OYiMBWNKiBxijlcVin1AryR8w9h53 kaLx7AHHzcuSh+ztmDlQOtGF1swcJ2o8G8MKDn9kGbNq2FnqN5SZpf5hkibRDjTq6ETI OqJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087382; x=1708692182; h=to:content-transfer-encoding:mime-version:subject:date:references :in-reply-to:message-id:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=FaNHHr3tQ1pZmSq7BDJeYMJLzSa6LK16q5JFFSL7bVY=; b=iLIx2yuj1hDF/lWA3YPhozGvQnwK7OvuKwyH6qnD6DjvTo/HexfjadDZ/WFlgNCywG +oggG6/7Q2VvOFNfdr7MVZuXcm1LXFs1NliKlAy6bK1g7bq42bt7Rfstwy38GD5T3F8R lQL5L6ocET3G3a3dIjt3eOlXokvVsspESLSBPRVF6WwmOHQGrHwaWZAH293mdqOfokuV +K9RRDk76aCmtRXf0064FQbkVCCdKIRExJKCFX960aYoA/dZ00hWgvn0zhRmgH8qYnza Y++MZk714ejxpnEbojza61tLUvgFRIPNLm1aYhyvrcHqKZIqDGJFhbEkHoD46dwddEH1 wSWQ== X-Gm-Message-State: AOJu0YwvHzopr4Grt8llg6TIAPwvSpeo+BzU/UJuPYzZWMg+LHq2mwLD qotR6fzENtnU+apFNdPuLTnG4mpMv9dU5THjaCDXIwRViGBMPO5XnslIyTWaOXs= X-Google-Smtp-Source: AGHT+IEmh/SYqShYuf/CRjmLbsLOjVVEnPN3tuYP6H9q0Y7mz9ReVcnzzSa0E+Mf5CULEF7e7K50zQ== X-Received: by 2002:a17:907:b9c6:b0:a3d:2e34:30a5 with SMTP id xa6-20020a170907b9c600b00a3d2e3430a5mr3238926ejc.29.1708087381722; Fri, 16 Feb 2024 04:43:01 -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 hw12-20020a170907a0cc00b00a3d5d8ff745sm1544090ejc.144.2024.02.16.04.43.00 for <68716@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:43:01 -0800 (PST) From: Vivien Kraus X-Google-Original-From: Vivien Kraus Message-ID: In-Reply-To: <5e0b95c296a3abfe2da6c1828dfbbc1a47886083.1708087345.git.liliana.prikler@gmail.com> References: <5e0b95c296a3abfe2da6c1828dfbbc1a47886083.1708087345.git.liliana.prikler@gmail.com> Date: Mon, 5 Feb 2024 18:05:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+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-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -1.01 X-Spam-Score: -1.01 X-Migadu-Queue-Id: 450606A883 X-TUID: HgEY9fwVPHBt Our udev service is capable of handling both rules and hardware databases. This patch makes it so that gnome can install any such needed rules or databases, while also allowing users to supply a list of names to ignore (via regular expressions). * gnu/services/desktop.scm (gnome-desktop-configuration): Add udev-ignorelist. (gnome-udev-resources): Rename to… (gnome-udev-configuration-files): … this. Account for udev-ignorelist. (gnome-desktop-service-type): Adjust accordingly. Change-Id: I6df4b896652581c42a35ea3ba1e4849ad72d12ef --- gnu/services/desktop.scm | 54 ++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 0667acfaba..0631571c49 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -82,6 +82,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) @@ -147,6 +148,7 @@ (define-module (gnu services desktop) gnome-desktop-configuration-shell gnome-desktop-configuration-utilities gnome-desktop-configuration-extra-packages + gnome-desktop-configuration-udev-ignorelist gnome-desktop-service gnome-desktop-service-type @@ -1417,7 +1419,13 @@ (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-ignorelist + (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 any package referenced in the other fields +are installed.")) (define (gnome-package gnome name) "Return the package NAME among the GNOME package inputs. NAME can be a @@ -1429,22 +1437,32 @@ (define (gnome-packages gnome names) "Return the package NAMES among the GNOME package inputs." (map (cut gnome-package gnome <>) names)) -(define (gnome-udev-rules config) - "Return the list of GNOME dependencies that provide udev rules." - (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-udev-configuration-files config) + "Return the GNOME udev rules and hardware files as computed from its +dependencies by filtering out the ignorelist." + (list + (computed-file + "gnome-udev-configurations" + (with-imported-modules + (source-module-closure '((guix build utils) + (guix build union))) + #~(begin + (use-modules (guix build utils) + (guix build union)) + ;; If rules.d or hwdb.d is not a proper directory but a symlink, + ;; then it will not be possible to delete individual files in this + ;; directory. + (union-build #$output + (search-path-as-list + (list "lib/udev" "libexec/udev") + (list #$@(gnome-profile config))) + #:create-all-directories? #t) + (for-each + (lambda (pattern) + (for-each + delete-file-recursively + (find-files #$output pattern))) + (list #$@(gnome-desktop-configuration-udev-ignorelist config)))))))) (define (gnome-polkit-settings config) "Return the list of GNOME dependencies that provide polkit actions and @@ -1487,7 +1505,7 @@ (define gnome-desktop-service-type (name 'gnome-desktop) (extensions (list (service-extension udev-service-type - gnome-udev-rules) + gnome-udev-configuration-files) (service-extension polkit-service-type gnome-polkit-settings) (service-extension profile-service-type -- 2.41.0