all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: Vivien Kraus <vivien@planete-kraus.eu>, 68716@debbugs.gnu.org
Cc: rg@raghavgururajan.name, maxim.cournoyer@gmail.com
Subject: [bug#68716] [PATCH gnome-team v2 5/5] services: gnome: Use a blocklist for udev configurations.
Date: Mon, 05 Feb 2024 21:52:34 +0100	[thread overview]
Message-ID: <2671e8ad3f84f79252e8b8ccfc5ebf7b13966ef2.camel@gmail.com> (raw)
In-Reply-To: <fd12cd63dda9dfb81881bd33466bd4df629212f4.1707163201.git.vivien@planete-kraus.eu>

Am Montag, dem 05.02.2024 um 19:30 +0100 schrieb Vivien Kraus:
> 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))))
You could reuse the function that we have to implement for the profile
service anyway, no?
> +    (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)))))))
IIRC, string-prefix matching is not a great idea with find-files. 
search-path-as-list from (guix build utils) is probably preferable.
> +             (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
Cheers

  reply	other threads:[~2024-02-05 20:54 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 16:12 [bug#68716] [PATCH gnome-team RFC 0/3] *** SUBJECT HERE *** Liliana Marie Prikler
2024-01-25 15:35 ` [bug#68716] [PATCH gnome-team RFC 1/3] services: Modularise gnome-desktop-configuration Liliana Marie Prikler
2024-01-25 17:12   ` Vivien Kraus via Guix-patches via
2024-01-25 17:38     ` Liliana Marie Prikler
2024-01-25 15:55 ` [bug#68716] [PATCH gnome-team RFC 2/3] gnu: Deprecate gnome meta-package Liliana Marie Prikler
2024-01-25 16:06 ` [bug#68716] [PATCH gnome-team RFC 3/3] services: gnome-desktop: Add core packages for GNOME 44 Liliana Marie Prikler
2024-01-26 21:13 ` [bug#68716] [PATCH gnome-team RFC 0/3] *** SUBJECT HERE *** Maxim Cournoyer
2024-02-05 20:00 ` [bug#68716] [PATCH gnome-team v2 0/5] Modularization of the gnome desktop service with udev blocklist Vivien Kraus via Guix-patches via
2024-01-25 15:35   ` [bug#68716] [PATCH gnome-team v2 1/5] services: Modularise gnome-desktop-configuration Liliana Marie Prikler
2024-01-25 15:55   ` [bug#68716] [PATCH gnome-team v2 3/5] gnu: Deprecate gnome meta-package Liliana Marie Prikler
2024-01-25 16:06   ` [bug#68716] [PATCH gnome-team v2 2/5] services: gnome-desktop: Add core packages for GNOME 44 Liliana Marie Prikler
2024-02-05 17:05   ` [bug#68716] [PATCH gnome-team v2 4/5] services: Rename gnome-udev-rules Vivien Kraus via Guix-patches via
2024-02-05 18:30   ` [bug#68716] [PATCH gnome-team v2 5/5] services: gnome: Use a blocklist for udev configurations Vivien Kraus via Guix-patches via
2024-02-05 20:52     ` Liliana Marie Prikler [this message]
2024-02-05 23:27 ` [bug#68716] [PATCH gnome-team v3 0/5] More elegant filtering of " Vivien Kraus via Guix-patches via
2024-01-25 15:35   ` [bug#68716] [PATCH gnome-team v3 1/5] services: Modularise gnome-desktop-configuration Liliana Marie Prikler
2024-01-25 15:55   ` [bug#68716] [PATCH gnome-team v3 3/5] gnu: Deprecate gnome meta-package Liliana Marie Prikler
2024-01-25 16:06   ` [bug#68716] [PATCH gnome-team v3 2/5] services: gnome-desktop: Add core packages for GNOME 44 Liliana Marie Prikler
2024-02-05 17:05   ` [bug#68716] [PATCH gnome-team v3 4/5] services: Rename gnome-udev-rules Vivien Kraus via Guix-patches via
2024-02-05 18:30   ` [bug#68716] [PATCH gnome-team v3 5/5] services: gnome: Use a blocklist for udev configurations Vivien Kraus via Guix-patches via
2024-02-06  5:13   ` [bug#68716] [PATCH gnome-team v3 0/5] More elegant filtering of " Liliana Marie Prikler
2024-02-07 21:38     ` Vivien Kraus via Guix-patches via
2024-02-16 10:53 ` [bug#68716] [PATCH v5 1/8] gnu: Split gnome into more meta-packages Liliana Marie Prikler
2024-01-25 15:35   ` [bug#68716] [PATCH v5 3/8] services: Modularise gnome-desktop-configuration Liliana Marie Prikler
2024-01-25 15:55   ` [bug#68716] [PATCH v5 7/8] gnu: Deprecate gnome meta-package Liliana Marie Prikler
2024-02-05 17:05   ` [bug#68716] [PATCH v5 4/8] services: Extend udev capabilities of gnome-desktop-service Vivien Kraus
2024-02-16 11:02   ` [bug#68716] [PATCH v5 2/8] gnu: gnome: Add core packages for GNOME 44 Liliana Marie Prikler
2024-02-16 12:08   ` [bug#68716] [PATCH v5 5/8] services: Extend polkit capabilities of gnome-desktop-service Liliana Marie Prikler
2024-02-16 12:35   ` [bug#68716] [PATCH v5 6/8] services: desktop: Remove unused imports Liliana Marie Prikler
2024-02-17  8:19   ` [bug#68716] [PATCH v5 8/8] gnu: gnome: Update synopsis and description Liliana Marie Prikler
2024-02-24  6:40   ` bug#68716: [PATCH v5 1/8] gnu: Split gnome into more meta-packages Liliana Marie Prikler
2024-02-16 10:53 ` [bug#68716] [PATCH gnome-team v4 1/7] " Liliana Marie Prikler
2024-01-25 15:35   ` [bug#68716] [PATCH gnome-team v4 3/7] services: Modularise gnome-desktop-configuration Liliana Marie Prikler
2024-01-25 15:55   ` [bug#68716] [PATCH gnome-team v4 7/7] gnu: Deprecate gnome meta-package Liliana Marie Prikler
2024-02-16 17:44     ` Vivien Kraus via Guix-patches via
2024-02-05 17:05   ` [bug#68716] [PATCH gnome-team v4 4/7] services: Extend udev capabilities of gnome-desktop-service Vivien Kraus
2024-02-16 11:02   ` [bug#68716] [PATCH gnome-team v4 2/7] gnu: gnome: Add core packages for GNOME 44 Liliana Marie Prikler
2024-02-16 12:08   ` [bug#68716] [PATCH gnome-team v4 5/7] services: Extend polkit capabilities of gnome-desktop-service Liliana Marie Prikler
2024-02-16 12:35   ` [bug#68716] [PATCH gnome-team v4 6/7] services: desktop: Remove unused imports Liliana Marie Prikler
2024-02-16 19:44   ` [bug#68716] [PATCH gnome-team v4 1/7] gnu: Split gnome into more meta-packages Maxim Cournoyer
2024-02-16 20:08     ` Liliana Marie Prikler
2024-02-17  7:50       ` Vivien Kraus via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2671e8ad3f84f79252e8b8ccfc5ebf7b13966ef2.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=68716@debbugs.gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=rg@raghavgururajan.name \
    --cc=vivien@planete-kraus.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.