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: 60443 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 7B8C027BBE9; Sat, 17 Feb 2024 08:26:14 +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 3DE2227BBE2 for ; Sat, 17 Feb 2024 08:26:09 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbG15-0006NL-VH; Sat, 17 Feb 2024 03:25: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 1rbG12-0006J8-UQ for guix-patches@gnu.org; Sat, 17 Feb 2024 03:25: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 1rbG12-000758-M4 for guix-patches@gnu.org; Sat, 17 Feb 2024 03:25:44 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbG1M-0005S5-CV for guix-patches@gnu.org; Sat, 17 Feb 2024 03:26:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68716] [PATCH v5 5/8] services: Extend polkit capabilities of gnome-desktop-service. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Feb 2024 08:26: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: rg@raghavgururajan.name, Vivien Kraus , Maxim Cournoyer Received: via spool by 68716-submit@debbugs.gnu.org id=B68716.170815834620883 (code B ref 68716); Sat, 17 Feb 2024 08:26:04 +0000 Received: (at 68716) by debbugs.gnu.org; 17 Feb 2024 08:25:46 +0000 Received: from localhost ([127.0.0.1]:60404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbG14-0005Qe-1I for submit@debbugs.gnu.org; Sat, 17 Feb 2024 03:25:46 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:48241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbG0u-0005P3-Dn for 68716@debbugs.gnu.org; Sat, 17 Feb 2024 03:25:40 -0500 Received: by mail-ed1-f67.google.com with SMTP id 4fb4d7f45d1cf-563e330351dso1648280a12.0 for <68716@debbugs.gnu.org>; Sat, 17 Feb 2024 00:25:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708158251; x=1708763051; darn=debbugs.gnu.org; h=mime-version:cc:to:subject:date:from:references:in-reply-to :message-id:from:to:cc:subject:date:message-id:reply-to; bh=77MF/Wc5xfDslCA8yVnEhnhiPyC9kkF8FZAf9ZvIMEQ=; b=dvvfmPWd4iIMBeepoSEvkt0lr1WrSBDksf87ANRzIDvB5KQ/sa8uCEdhSrWa1CYwfl lJmnK5qq1bmq+IZsVqdlqV8meHhkLDL9WYpLMLuTWHSOJbrJNnxwAVD4Wyp3jhyEQbAt cHsfRN1mpvDXCMB+mkA3L/f+LEvNGVD17eTzh2Pp8ikf/1ItxriY5P22mF2toOrqrmBU DyDC2WYa/w10kdmKLfx7Z/9Qi9Q5Oug33B9z1s0OTUYNW/Jv9QK9FpH3k8pIg8s4wrbt YB7ATfNQNpcUWPa2JwcW+TgKAlKupQNOI7xyxjXlOn2QjsxoN87asu8TR2oJAbhMZ+Qx euIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708158251; x=1708763051; h=mime-version:cc: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=uIH+D/0SSdE9Cuf3KE2lP895/axNnRYuKA4wM5YxhekZzHa+n3fzX/sDiyvSUYvD9y mtV+xxxfngf0mt6K8QBCbQfccZWjSBquh4E3RvS5RGMGL5mTUtrB7VSknvj38e5z8NVg BLIeec+jICGABco7DMi1qGfsOWtlpGe0MQYOcR+p+kZVG84XI00lOtbfIzbGxlonNrwa bG0TkbNSNjxOdL70vzWJG1qKLvFIsMKhRQmG7MvAPUDtRS1u8ny3F1QrxxOVjnjbVmlr bC0trd605Wpc1sAM4pz6U37xWtDJXGUXczHaEk0vEzO5CrpKo7p5NXqTfO192P0qZqcw 7l/g== X-Gm-Message-State: AOJu0YxOYfZ3sqh9a5KVlBaY8C92/CmzPpO+YVT6q51lt1Fp92c+x47F fol55U0QJOCVOhhGNeMDREJ9u8qhJqgNAOeXOpB0CL+ewXdvfOs2bAgF8h2duwg= X-Google-Smtp-Source: AGHT+IH4v+mjpbOMW7DA0k9gLrl/FX3y4dbubGjZwyGcwTE+E/XL9o+QDN90yC6I94/j8YTfVB4EWA== X-Received: by 2002:aa7:da48:0:b0:564:329e:5832 with SMTP id w8-20020aa7da48000000b00564329e5832mr216005eds.18.1708158251031; Sat, 17 Feb 2024 00:24:11 -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 cs1-20020a0564020c4100b005617cebd051sm707218edb.78.2024.02.17.00.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 00:24:10 -0800 (PST) Message-ID: <546e128bfc3a77723987a842d5979c08a4153c6c.1708158195.git.liliana.prikler@gmail.com> In-Reply-To: References: 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."