Package: guix-patches;
Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Date: Sun, 26 Jan 2025 02:51:02 UTC
Severity: normal
Tags: patch
Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75847 in the body.
You can then email your comments to 75847 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org
:bug#75847
; Package guix-patches
.
(Sun, 26 Jan 2025 02:51:02 GMT) Full text and rfc822 format available.Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org
.
(Sun, 26 Jan 2025 02:51:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: guix-patches <at> gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 0/2] Reinstate auto-configuration for GNOME Boxes. Date: Sun, 26 Jan 2025 11:50:08 +0900
A recent regression had made the GNOME Boxes USB redirection feature harder to configure. This changes makes it so that adding the 'gnome-boxes' package to e.g. the 'extra-packages' field of your gnome-desktop-configuration will autoconfigure it as it used to be the case. Maxim Cournoyer (2): services/desktop: Use transitively propagated GNOME packages for polkit/udev. services/gnome: Reinstate auto-configuration for GNOME Boxes. gnu/packages/gnome.scm | 32 +++++++++++++++----- gnu/services/desktop.scm | 63 ++++++++++++++++++++++++++++------------ 2 files changed, 69 insertions(+), 26 deletions(-) base-commit: 4797fb64caf7bf869b0183c96e1c24885313abbc -- 2.47.1
guix-patches <at> gnu.org
:bug#75847
; Package guix-patches
.
(Sun, 26 Jan 2025 02:57:02 GMT) Full text and rfc822 format available.Message #8 received at 75847 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 75847 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 1/2] services/desktop: Use transitively propagated GNOME packages for polkit/udev. Date: Sun, 26 Jan 2025 11:55:46 +0900
This is useful for automatically picking up the polkit or udev rules from the GNOME packages propagated inputs (transitively), e.g. spice-gtk from the gnome-boxes package. * gnu/services/desktop.scm (gnome-profile): Add a #:transitive? argument. (gnome-udev-configuration-files): Use it. (gnome-polkit-settings): Likewise. Change-Id: I3597c9d3dc296e8f3e45017bb02e500db0b73783 --- gnu/services/desktop.scm | 42 ++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index a0291ea222..a214d5b6a2 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -1547,7 +1547,7 @@ (define (gnome-udev-configuration-files config) (union-build #$output (search-path-as-list (list "lib/udev" "libexec/udev") - (list #$@(gnome-profile config))) + (list #$@(gnome-profile config #:transitive? #t))) #:create-all-directories? #t) (for-each (lambda (pattern) @@ -1572,7 +1572,7 @@ (define (gnome-polkit-settings config) (union-build output (search-path-as-list (list "share/polkit-1") - (list #$@(gnome-profile config))) + (list #$@(gnome-profile config #:transitive? #t))) #:create-all-directories? #t) (for-each (lambda (pattern) @@ -1581,21 +1581,29 @@ (define (gnome-polkit-settings config) (find-files output pattern))) (list #$@(gnome-desktop-configuration-polkit-ignorelist config)))))))) -(define (gnome-profile config) - "Return a list of packages propagated through CONFIG." - (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))) +(define* (gnome-profile config #:key transitive?) + "Return the list of the packages specified in CONFIG. When TRANSITIVE? is +#t, also include their transitive propagated inputs." + (define gnome-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))) + (if transitive? + (append gnome-packages + (append-map (compose (cut map second <>) ;discard labels + package-transitive-propagated-inputs) + gnome-packages)) + gnome-packages)) (define gnome-desktop-service-type (service-type base-commit: 4797fb64caf7bf869b0183c96e1c24885313abbc -- 2.47.1
liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org
:bug#75847
; Package guix-patches
.
(Sun, 26 Jan 2025 02:57:02 GMT) Full text and rfc822 format available.Message #11 received at 75847 <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: 75847 <at> debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Subject: [PATCH 2/2] services/gnome: Reinstate auto-configuration for GNOME Boxes. Date: Sun, 26 Jan 2025 11:55:47 +0900
Previously to 4722496292 ("Remove gnome-boxes from default GNOME apps."), USB redirection for GNOME Boxes had been working out of the box. Reinstate the extensions that made that possible, so that simply adding the gnome-boxes package back to one of the gnome-desktop-configuration fields does the right thing. * gnu/services/desktop.scm (gnome-setuid-programs): New procedure. (gnome-desktop-service-type) [privileged-program-service-type]: Use it as an extension. * gnu/packages/gnome.scm (gnome-boxes): [inputs]: Move spice-gtk to... [propagated-inputs]: ... here. [description]: Document extra steps necessary to enable the USB redirection feature. Change-Id: If84e8a2e0c480ddd1d7cd294890fad1ae2a76987 --- gnu/packages/gnome.scm | 32 ++++++++++++++++++++++++-------- gnu/services/desktop.scm | 21 ++++++++++++++++++++- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index c831d5ee0d..1225570c3c 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -39,7 +39,7 @@ ;;; Copyright © 2019, 2024, 2025 Giacomo Leidi <goodoldpaul <at> autistici.org> ;;; Copyright © 2019 Jelle Licht <jlicht <at> fsfe.org> ;;; Copyright © 2019 Jonathan Frederickson <jonathan <at> terracrypt.net> -;;; Copyright © 2019-2024 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> +;;; Copyright © 2019-2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2019, 2020 Martin Becze <mjbecze <at> riseup.net> ;;; Copyright © 2019 David Wilson <david <at> daviwil.com> ;;; Copyright © 2019, 2020 Raghav Gururajan <raghavgururajan <at> disroot.org> @@ -12813,22 +12813,38 @@ (define-public gnome-boxes libxml2 qemu-minimal ;for qemu-img sparql-query - spice-gtk tracker vte webkitgtk-for-gtk3)) + (propagated-inputs + ;; Propagating spice-gtk is necessary so that the gnome-desktop-service + ;; type configures the polkit actions necessary for the USB redirection + ;; feature to work when gnome-boxes added as a extra GNOME package. + (list spice-gtk)) (home-page "https://wiki.gnome.org/Apps/Boxes") (synopsis "View, access, and manage remote and virtual systems") (description "GNOME Boxes is a simple application to view, access, and manage remote and virtual systems. Note that this application requires the @code{libvirt} and @code{virtlog} daemons to run. Use the command @command{info '(guix) Virtualization Services'} to learn how to configure -these services on the Guix System. If you do not use the -@code{gnome-desktop-service-type}, you will also want to extend the -@code{polkit-service-type} with the @code{spice-gtk} package, as well as -configure the @file{libexec/spice-client-glib-usb-acl-helper} executable of -@code{spice-gtk} as setuid, to make it possible to redirect USB devices as a -non-privileged user.") +these services on the Guix System. + +To make it possible to redirect USB devices as a non-privileged user, some +extra configuration is necessary: if you use the +@code{gnome-desktop-service-type}, you should add the @code{gnome-boxes} +package to the @code{extra-packages} field of the +@code{gnome-desktop-configuration}, for example: +@lisp +(service gnome-desktop-service-type + (gnome-desktop-configuration + (extra-packages (list gnome-boxes gnome-essential-extras)))) +@end lisp +If you do @emph{not} use the @code{gnome-desktop-service-type}, you will need +manually extend the @code{polkit-service-type} with the @code{spice-gtk} +package, as well as configure the +@file{libexec/spice-client-glib-usb-acl-helper} executable of @code{spice-gtk} +as setuid, to make it possible to redirect USB devices as a non-privileged +user.") (license (list ;; For data/icons/empty-boxes.png. license:cc-by2.0 diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index a214d5b6a2..abb8eee200 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2015 Andy Wingo <wingo <at> igalia.com> ;;; Copyright © 2015 Mark H Weaver <mhw <at> netris.org> ;;; Copyright © 2016 Sou Bunnbu <iyzsong <at> gmail.com> -;;; Copyright © 2017, 2020, 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> +;;; Copyright © 2017, 2020, 2022, 2023, 2025 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2017 Nikita <nikita <at> n0.is> ;;; Copyright © 2017, 2019 Hartmut Goebel <h.goebel <at> crazy-compilers.com> ;;; Copyright © 2018, 2020, 2022 Efraim Flashner <efraim <at> flashner.co.il> @@ -1605,6 +1605,23 @@ (define* (gnome-profile config #:key transitive?) gnome-packages)) gnome-packages)) +(define (gnome-setuid-programs config) + "Return the list of setuid programs found within the packages specified in +CONFIG, a <gnome-desktop-configuration> object." + ;; spice-gtk provides polkit actions for USB redirection in GNOME Boxes; set + ;; its usb-acl-helper script setuid automatically when the gnome-boxes or + ;; spice-gtk packages are added to one of the gnome-desktop-configuration + ;; fields. + (let* ((gnome-packages (gnome-profile config #:transitive? #t)) + (spice-gtk (find (compose (cut string=? "spice-gtk" <>) package-name) + gnome-packages)) + (files `(,@(if spice-gtk + (list (file-append + spice-gtk + "/libexec/spice-client-glib-usb-acl-helper")) + '())))) + (map file-like->setuid-program files))) + (define gnome-desktop-service-type (service-type (name 'gnome-desktop) @@ -1613,6 +1630,8 @@ (define gnome-desktop-service-type gnome-udev-configuration-files) (service-extension polkit-service-type gnome-polkit-settings) + (service-extension privileged-program-service-type + gnome-setuid-programs) (service-extension profile-service-type gnome-profile))) (default-value (gnome-desktop-configuration)) -- 2.47.1
guix-patches <at> gnu.org
:bug#75847
; Package guix-patches
.
(Sun, 26 Jan 2025 06:41:02 GMT) Full text and rfc822 format available.Message #14 received at 75847 <at> debbugs.gnu.org (full text, mbox):
From: Liliana Marie Prikler <liliana.prikler <at> gmail.com> To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>, 75847 <at> debbugs.gnu.org Subject: Re: [PATCH 1/2] services/desktop: Use transitively propagated GNOME packages for polkit/udev. Date: Sun, 26 Jan 2025 07:40:14 +0100
Am Sonntag, dem 26.01.2025 um 11:55 +0900 schrieb Maxim Cournoyer: > This is useful for automatically picking up the polkit or udev rules > from the GNOME packages propagated inputs (transitively), e.g. spice- > gtk from the gnome-boxes package. > > * gnu/services/desktop.scm (gnome-profile): Add a #:transitive? > argument. > (gnome-udev-configuration-files): Use it. > (gnome-polkit-settings): Likewise. > > Change-Id: I3597c9d3dc296e8f3e45017bb02e500db0b73783 > --- > > gnu/services/desktop.scm | 42 ++++++++++++++++++++++++-------------- > -- > 1 file changed, 25 insertions(+), 17 deletions(-) > > diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm > index a0291ea222..a214d5b6a2 100644 > --- a/gnu/services/desktop.scm > +++ b/gnu/services/desktop.scm > @@ -1547,7 +1547,7 @@ (define (gnome-udev-configuration-files config) > (union-build #$output > (search-path-as-list > (list "lib/udev" "libexec/udev") > - (list #$@(gnome-profile config))) > + (list #$@(gnome-profile config #:transitive? > #t))) > #:create-all-directories? #t) > (for-each > (lambda (pattern) > @@ -1572,7 +1572,7 @@ (define (gnome-polkit-settings config) > (union-build output > (search-path-as-list > (list "share/polkit-1") > - (list #$@(gnome-profile config))) > + (list #$@(gnome-profile config #:transitive? > #t))) > #:create-all-directories? #t) > (for-each > (lambda (pattern) > @@ -1581,21 +1581,29 @@ (define (gnome-polkit-settings config) > (find-files output pattern))) > (list #$@(gnome-desktop-configuration-polkit-ignorelist > config)))))))) > > -(define (gnome-profile config) > - "Return a list of packages propagated through CONFIG." > - (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))) > +(define* (gnome-profile config #:key transitive?) > + "Return the list of the packages specified in CONFIG. When > TRANSITIVE? is > +#t, also include their transitive propagated inputs." > + (define gnome-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))) > + (if transitive? > + (append gnome-packages > + (append-map (compose (cut map second <>) ;discard > labels > + package-transitive-propagated- > inputs) > + gnome-packages)) There is a small bug in here in that packages with outputs will have said output ignored. This typically doesn't matter, but for the sake of completeness, something like (match-lambda ((_ pkg) pkg) ((_ pkg out) (list pkg out))) preserves the output. > + gnome-packages)) > > (define gnome-desktop-service-type > (service-type > > base-commit: 4797fb64caf7bf869b0183c96e1c24885313abbc Other than that, the series LGTM. Cheers
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:Message #19 received at 75847-done <at> debbugs.gnu.org (full text, mbox):
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com> To: Liliana Marie Prikler <liliana.prikler <at> gmail.com> Cc: 75847-done <at> debbugs.gnu.org Subject: Re: [PATCH 1/2] services/desktop: Use transitively propagated GNOME packages for polkit/udev. Date: Mon, 27 Jan 2025 02:05:30 +0900
Hi Liliana, Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes: [...] >> +(define* (gnome-profile config #:key transitive?) >> + "Return the list of the packages specified in CONFIG. When >> TRANSITIVE? is >> +#t, also include their transitive propagated inputs." >> + (define gnome-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))) >> + (if transitive? >> + (append gnome-packages >> + (append-map (compose (cut map second <>) ;discard >> labels >> + package-transitive-propagated- >> inputs) >> + gnome-packages)) > There is a small bug in here in that packages with outputs will have > said output ignored. This typically doesn't matter, but for the sake > of completeness, something like > (match-lambda > ((_ pkg) pkg) > ((_ pkg out) (list pkg out))) > preserves the output. Well observed. I've used something similar to the above, but using gexp-input objects so that lowering the gexp would result in store paths compatible with the 'search-path-as-list' for example. I added Reviewed-by git trailers to credit your review and pushed, after testing I could successfully reconfigure my system with the change. -- Thanks, Maxim
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Mon, 24 Feb 2025 12:24:11 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.