From patchwork Fri Feb 16 12:08:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 60428 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 E7D4B27BBE2; Fri, 16 Feb 2024 12:45:35 +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 7859C27BBE9 for ; Fri, 16 Feb 2024 12:45:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raxaB-00007k-MN; 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 1raxa9-00006c-ED for guix-patches@gnu.org; Fri, 16 Feb 2024 07:44:45 -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 1raxa9-0004RA-5j for guix-patches@gnu.org; Fri, 16 Feb 2024 07:44:45 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1raxaS-0008E1-CS; Fri, 16 Feb 2024 07:45:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68716] [PATCH gnome-team v4 5/7] services: Extend polkit capabilities of gnome-desktop-service. 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: Fri, 16 Feb 2024 12:45:04 +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.170808747431512 (code B ref 68716); Fri, 16 Feb 2024 12:45:04 +0000 Received: (at 68716) by debbugs.gnu.org; 16 Feb 2024 12:44:34 +0000 Received: from localhost ([127.0.0.1]:57998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raxZx-0008C6-V3 for submit@debbugs.gnu.org; Fri, 16 Feb 2024 07:44:34 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:48192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1raxZr-0008Al-Bq for 68716@debbugs.gnu.org; Fri, 16 Feb 2024 07:44:29 -0500 Received: by mail-ej1-f65.google.com with SMTP id a640c23a62f3a-a3d82926ed2so89414166b.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=mime-version:to:subject:date:from:references:in-reply-to:message-id :from:to:cc:subject:date:message-id:reply-to; bh=77MF/Wc5xfDslCA8yVnEhnhiPyC9kkF8FZAf9ZvIMEQ=; b=fGPihckD28EED6hmzNM1UGJySU72SznA42B2CCrgGAt5PIct68140DCknFzInxgfW3 0QhikoCoEey6p037co2ffPWb/TeXY6D0RW6vPwT2nr3iH6xUh58EipQ2dl0W/fzS6Nyl Gv4qb+9aaxA8tR47Ns2+xLPMpac7utGki8cMfT5+qiO68n4mtttDlmIVEQPnb+6rYloP ooBhRw0Ezw0w5PQ3GjAg4Jnl6YQpGIYN4QRLV8lTZi5FMnSH6rmWSUrP8Z22JG4u/ll9 ydjtiQ7slgCHGLwP5cRYTQSsl4AMs6X4sPdLksnETXx2B1yOdnoXZBEKmcTvLCqGUUdA ZTvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708087382; x=1708692182; h=mime-version:to:subject:date:from:references:in-reply-to:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=77MF/Wc5xfDslCA8yVnEhnhiPyC9kkF8FZAf9ZvIMEQ=; b=eYCcHl+ZqsiXA2Sm5avT0emv/yT2q/gfGGiR1RCxYwnU4jB6DxWANMKRHypV4+bLQb mrP2r93kWRjicoTdGRPVKjgfLPTgiYAvTrLPxyrf2mh4pAClQqC/unPRmtMUSt6LMNKu x/29BPn92CokBk6lJhUw+mAXERZ+2xBTqNdB+cHbXNDz/uMpTwrz0yGukfRqpBzwAz5C vbXweuRjYoERWZGJzwipmPVszviX25mpXv9AVKxlW+h4jyex4knvQGkDGwf/AbcySpCN lDIbbTK+Gxqoqe1yWkyipciLnAjRbaQizUxFsbmZw2bK0a8RbSvt3ElKEk0mIZjWaFYX Qgsg== X-Gm-Message-State: AOJu0Yzh0rSpytUJnwvzr1ZP6q+wYNl9h2DSudQF//+5h4ZX7iyokbCj uNPLGfXW3fuY/vp6IfknOdpteAyC6YEL+7fJAYZKC7RgkSEZLZfSBFHxkobfL9U= X-Google-Smtp-Source: AGHT+IHhZS7CkKt/asfzc5dZK3kXfcLErc5AsCgoVVlq/b0Eqnxo/ef7mAB6RT5N9zg2klSJzN0o6Q== X-Received: by 2002:a17:906:a2c6:b0:a3c:ed94:5612 with SMTP id by6-20020a170906a2c600b00a3ced945612mr3635428ejb.27.1708087382398; Fri, 16 Feb 2024 04:43:02 -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.01 for <68716@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 04:43:02 -0800 (PST) Message-ID: <00013ffb07bdd7231f561e8c6c5d220d33b3e32f.1708087345.git.liliana.prikler@gmail.com> In-Reply-To: <5e0b95c296a3abfe2da6c1828dfbbc1a47886083.1708087345.git.liliana.prikler@gmail.com> References: <5e0b95c296a3abfe2da6c1828dfbbc1a47886083.1708087345.git.liliana.prikler@gmail.com> From: Liliana Marie Prikler Date: Fri, 16 Feb 2024 13:08:11 +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 As with our udev extension, this makes it so that all inputs are considered modulo a new ignorelist. * gnu/services/desktop.scm (gnome-desktop-configuration): Add polkit-ignorelist. (gnome-polkit-settings): Adjust accordingly. --- gnu/services/desktop.scm | 44 ++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 0631571c49..b3c0f4fc41 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1425,7 +1425,12 @@ (define-configuration/no-serialization gnome-desktop-configuration "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.")) +are installed.") + (polkit-ignorelist + (list-of-strings '()) + "A list of regular expressions denoting polkit rules provided by any package +that should not be installed. By default, every polkit rule added 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 @@ -1467,22 +1472,27 @@ (define (gnome-udev-configuration-files config) (define (gnome-polkit-settings config) "Return the list of GNOME dependencies that provide polkit actions and rules." - (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")))))))) + (list + (computed-file + "gnome-polkit-settings" + (with-imported-modules + (source-module-closure '((guix build utils) + (guix build union))) + #~(let ((output (string-append #$output "/share/polkit-1"))) + (use-modules (guix build utils) + (guix build union)) + (mkdir-p (dirname output)) + (union-build output + (search-path-as-list + (list "share/polkit-1") + (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-polkit-ignorelist config)))))))) (define (gnome-profile config) "Return a list of packages propagated through CONFIG."